1 /*
2  *  cASCPPParameter_NativeObjectSupport.h
3  *  Avida
4  *
5  *  Created by David on 10/13/08.
6  *  Copyright 2008-2011 Michigan State University. All rights reserved.
7  *
8  *
9  *  This file is part of Avida.
10  *
11  *  Avida is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
12  *  as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
13  *
14  *  Avida is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public License along with Avida.
18  *  If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef cASCPPParameter_NativeObjectSupport_h
23 #define cASCPPParameter_NativeObjectSupport_h
24 
25 #include "cASCPPParameter.h"
26 #include "cASNativeObject.h"
27 
28 
Get()29 template<typename T> inline T cASCPPParameter::Get() const
30 {
31   if (strcmp(m_nobj->GetType(), typeid(T).name()) != 0)
32     exit(AS_EXIT_INTERNAL_ERROR); // @AS_TODO - report type mismatch error
33   return (T)m_nobj->GetObject();
34 }
35 
36 #endif
37