aGrUM  0.14.2
PRMAttribute_tpl.h
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
27 namespace gum {
28  namespace prm {
29 
30  template < typename GUM_SCALAR >
31  PRMAttribute< GUM_SCALAR >::PRMAttribute(const std::string& name) :
32  PRMClassElement< GUM_SCALAR >(name) {
33  GUM_CONSTRUCTOR(PRMAttribute);
34  }
35 
36  template < typename GUM_SCALAR >
38  const PRMAttribute< GUM_SCALAR >& source) :
39  PRMClassElement< GUM_SCALAR >(source) {
40  GUM_CONS_CPY(PRMAttribute);
41  GUM_ERROR(OperationNotAllowed, "Cannot copy Attributes");
42  }
43 
44  template < typename GUM_SCALAR >
46  GUM_DESTRUCTOR(PRMAttribute);
47  }
48 
49  template < typename GUM_SCALAR >
51  auto old_type = this->_type();
52  this->_type(source->_type());
53  source->_type(old_type);
54  }
55 
56  } /* namespace prm */
57 } /* namespace gum */
PRMAttribute(const std::string &name)
Destructor.
Abstract class representing an element of PRM class.
virtual PRMType * _type()=0
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
PRMAttribute is a member of a Class in a PRM.
Definition: PRMAttribute.h:58
#define GUM_ERROR(type, msg)
Definition: exceptions.h:52