aGrUM  0.14.2
PRMReferenceSlot.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 #ifndef GUM_REFERENCE_SLOT_H
28 #define GUM_REFERENCE_SLOT_H
29 
32 
33 namespace gum {
34  namespace prm {
35 
56  // ==========================================================================
57  template < typename GUM_SCALAR >
58  class PRMReferenceSlot : public PRMClassElement< GUM_SCALAR > {
59  public:
60  // ========================================================================
62  // ========================================================================
64 
72  PRMReferenceSlot(const std::string& name,
73  PRMClassElementContainer< GUM_SCALAR >& type,
74  bool isArray = false);
75 
79  virtual ~PRMReferenceSlot();
80 
82  // ========================================================================
84  // ========================================================================
86 
91  elt_type() const;
92 
97  PRMClassElementContainer< GUM_SCALAR >& slotType();
98 
103  const PRMClassElementContainer< GUM_SCALAR >& slotType() const;
104 
108  bool isArray() const;
109 
111  virtual void addParent(const PRMClassElement< GUM_SCALAR >& elt);
112 
114  virtual void addChild(const PRMClassElement< GUM_SCALAR >& elt);
115 
117  // ========================================================================
119  // ========================================================================
121 
124  virtual PRMType& type();
125 
128  virtual const PRMType& type() const;
129 
132  virtual Potential< GUM_SCALAR >& cpf();
133 
136  virtual const Potential< GUM_SCALAR >& cpf() const;
137 
140  virtual PRMAttribute< GUM_SCALAR >* getCastDescendant() const;
141 
143  private:
144  // ========================================================================
146  // ========================================================================
147  // @{
148 
150  PRMReferenceSlot(const PRMReferenceSlot< GUM_SCALAR >& source);
151 
153  PRMReferenceSlot& operator=(const PRMReferenceSlot< GUM_SCALAR >& from);
154 
156  // ========================================================================
158  // ========================================================================
159  // @{
160 
163 
165  bool __isArray;
166 
168  };
169 
170 
171 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
172  extern template class PRMReferenceSlot< double >;
173 #endif
174 
175 
176  } /* namespace prm */
177 } // namespace gum
178 
180 
181 #endif /* GUM_CLASS_ELEMENT_H */
bool isArray() const
Returns true if this reference slot is an array.
virtual ~PRMReferenceSlot()
Destructor.
virtual Potential< GUM_SCALAR > & cpf()
Raise an OperationNotAllowed. See gum::PRMClassElement::cpf().
const std::string & name() const
Returns the name of this object.
Definition: PRMObject_inl.h:32
PRMReferenceSlot & operator=(const PRMReferenceSlot< GUM_SCALAR > &from)
Copy operator. Don&#39;t use it.
virtual void addParent(const PRMClassElement< GUM_SCALAR > &elt)
See gum::PRMClassElement::addParent().
PRMClassElementContainer< GUM_SCALAR > & __slotType
The type of this PRMReferenceSlot.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
PRMClassElementContainer< GUM_SCALAR > & slotType()
Returns the type of this slot, which is a PRMClassElementContainer (it is not the type of PRMObject)...
virtual PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const
Implementation of the pure virtual method of PRMObject.
PRMReferenceSlot(const std::string &name, PRMClassElementContainer< GUM_SCALAR > &type, bool isArray=false)
Default constructor.
virtual void addChild(const PRMClassElement< GUM_SCALAR > &elt)
See gum::PRMClassElement::addChild().
bool __isArray
Flag indicating if this slot is an array.
Headers of gum::PRMClassElement.
<agrum/PRM/classElementContainer.h>
virtual PRMAttribute< GUM_SCALAR > * getCastDescendant() const
Raise an OperationNotAllowed. See gum::PRMClassElement::getCastDescendant().
Inline implementation of gum::PRMReferenceSlot.
Headers of gum::prm::PRMClassElementContainer.
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.
virtual PRMType & type()
Raise an OperationNotAllowed. See gum::PRMClassElement::type().