36 template <
typename GUM_SCALAR >
39 __implements(nullptr), __bijection(nullptr) {
43 template <
typename GUM_SCALAR >
46 bool delayInheritance) :
48 __superClass(&super), __implements(nullptr),
52 if (!delayInheritance) {
54 __inheritClass(super);
58 template <
typename GUM_SCALAR >
61 bool delayInheritance) :
63 __superClass(nullptr),
65 __bijection(nullptr) {
68 if (!delayInheritance) { __implementInterfaces(
false); }
71 template <
typename GUM_SCALAR >
75 bool delayInheritance) :
77 __superClass(&super), __implements(nullptr),
81 if (!delayInheritance) {
83 __inheritClass(super);
87 if (__implements ==
nullptr) {
90 for (
const auto elt :
set) {
95 if (!delayInheritance) { __implementInterfaces(
false); }
98 template <
typename GUM_SCALAR >
100 for (
const auto impl : *__implements) {
101 impl->__addImplementation(
this);
102 if ((!__superClass) || (!super().isSubTypeOf(*impl))
103 || delayedInheritance) {
105 for (
auto ref : impl->referenceSlots()) {
106 __dag.addNodeWithId(ref->id());
109 for (
auto attr : impl->attributes()) {
110 __dag.addNodeWithId(attr->id());
116 template <
typename GUM_SCALAR >
120 for (
const auto& elt : __nodeIdMap) {
124 if (__implements) {
delete __implements; }
126 if (__bijection) {
delete __bijection; }
129 template <
typename GUM_SCALAR >
134 if (__superClass->__implements) {
137 *(__superClass->__implements));
139 for (
auto i : *(__superClass->__implements)) {
140 __implements->insert(i);
145 if (__implements) { __implementInterfaces(
true); }
148 template <
typename GUM_SCALAR >
152 for (
const auto c_refslot : __superClass->__referenceSlots) {
156 c_refslot->slotType()),
157 c_refslot->isArray());
159 ref->
setId(c_refslot->id());
161 if (!__dag.existsNode(ref->id())) { __dag.addNodeWithId(ref->id()); }
162 __nodeIdMap.insert(ref->id(), ref);
163 __referenceSlots.insert(ref);
165 if (__superClass->__nameMap[c_refslot->name()]
166 == __superClass->__nameMap[c_refslot->safeName()]) {
167 __nameMap.insert(ref->name(), ref);
170 __nameMap.insert(ref->safeName(), ref);
175 template <
typename GUM_SCALAR >
179 for (
const auto c_param : __superClass->__parameters) {
181 c_param->name(), c_param->valueType(), c_param->value());
183 __parameters.insert(param);
185 param->
setId(c_param->id());
186 __dag.addNodeWithId(param->id());
187 __nodeIdMap.insert(param->id(), param);
188 __nameMap.insert(param->name(), param);
193 template <
typename GUM_SCALAR >
196 for (
const auto c_attr : __superClass->__attributes) {
199 auto attr = c_attr->newFactory(*
this);
201 __bijection->insert(&(c_attr->type().variable()),
202 &(attr->type().variable()));
203 attr->setId(c_attr->id());
205 __dag.addNodeWithId(attr->id());
209 __nodeIdMap.insert(attr->id(), attr);
210 __attributes.insert(attr);
212 if (__superClass->__nameMap[c_attr->name()]
213 == __superClass->__nameMap[c_attr->safeName()]) {
214 __nameMap.insert(attr->name(), attr);
217 __nameMap.insert(attr->safeName(), attr);
222 template <
typename GUM_SCALAR >
225 for (
const auto c_agg : __superClass->__aggregates) {
230 c_agg->name(), c_agg->agg_type(), c_agg->type(), c_agg->label());
233 c_agg->name(), c_agg->agg_type(), c_agg->type());
238 __bijection->insert(&(c_agg->type().variable()),
239 &(agg->
type().variable()));
240 agg->
setId(c_agg->id());
241 __dag.addNodeWithId(agg->
id());
242 __nodeIdMap.insert(agg->
id(), agg);
243 __aggregates.insert(agg);
245 if (__superClass->__nameMap[c_agg->name()]
246 == __superClass->__nameMap[c_agg->safeName()])
247 __nameMap.insert(agg->
name(), agg);
249 __nameMap.insert(agg->
safeName(), agg);
254 template <
typename GUM_SCALAR >
258 for (
const auto c_sc : __superClass->__slotChains) {
260 if (!(__nameMap.exists(c_sc->name())
261 && __nameMap.exists(c_sc->safeName()))) {
265 auto chain = c_sc->chain();
267 chain.setAtPos(0, __nameMap[c_sc->chain().front()->name()]);
270 __bijection->insert(&(c_sc->type().variable()),
271 &(sc->type().variable()));
272 sc->
setId(c_sc->id());
273 __dag.addNodeWithId(sc->id());
274 __nodeIdMap.insert(sc->id(), sc);
275 __slotChains.insert(sc);
277 if (!__nameMap.exists(sc->name())) {
278 __nameMap.insert(sc->name(), sc);
280 if (!__nameMap.exists(sc->safeName())) {
281 __nameMap.insert(sc->safeName(), sc);
288 template <
typename GUM_SCALAR >
291 auto& elt = this->
get(name);
295 "you can only complete inheritance for attributes");
298 for (
const auto& prnt : super().containerDag().parents(elt.id())) {
299 this->addArc(super().
get(prnt).safeName(), elt.safeName());
306 attr.
copyCpf(*__bijection, super_attr);
311 template <
typename GUM_SCALAR >
322 __implements->insert(i);
336 c_param->name(), c_param->valueType(), c_param->value());
338 __parameters.insert(param);
340 param->
setId(c_param->id());
341 __nodeIdMap.insert(param->id(), param);
342 __nameMap.insert(param->name(), param);
349 auto attr = c_attr->newFactory(*
this);
351 bij.
insert(&(c_attr->type().variable()), &(attr->type().variable()));
352 attr->setId(c_attr->id());
353 __nodeIdMap.insert(attr->id(), attr);
354 __attributes.insert(attr);
357 __nameMap.insert(attr->name(), attr);
360 __nameMap.insert(attr->safeName(), attr);
369 c_agg->name(), c_agg->agg_type(), c_agg->type(), c_agg->label());
372 c_agg->name(), c_agg->agg_type(), c_agg->type());
375 bij.
insert(&(c_agg->type().variable()), &(agg->
type().variable()));
376 agg->
setId(c_agg->id());
377 __nodeIdMap.insert(agg->
id(), agg);
378 __aggregates.insert(agg);
381 __nameMap.insert(agg->
name(), agg);
383 __nameMap.insert(agg->
safeName(), agg);
391 c_refslot->slotType()),
392 c_refslot->isArray());
394 ref->
setId(c_refslot->id());
395 __nodeIdMap.insert(ref->
id(), ref);
396 __referenceSlots.insert(ref);
399 __nameMap.insert(ref->
name(), ref);
401 __nameMap.insert(ref->
safeName(), ref);
411 chain.
setAtPos(0, __nameMap[c_slotchain->chain().front()->name()]);
415 bij.
insert(&(c_slotchain->type().variable()), &(sc->
type().variable()));
416 sc->
setId(c_slotchain->id());
417 __nodeIdMap.insert(sc->
id(), sc);
418 __slotChains.insert(sc);
420 __nameMap.insert(sc->
name(), sc);
421 __nameMap.insert(sc->
safeName(), sc);
426 __nodeIdMap[arc.tail()]->addChild(*(__nodeIdMap[arc.head()]));
427 __nodeIdMap[arc.head()]->addParent(*(__nodeIdMap[arc.tail()]));
431 this->_copyIOFlags(c);
435 __nameMap[attr->safeName()]);
441 template <
typename GUM_SCALAR >
445 case PRMObject::prm_type::CLASS: {
448 while (current != 0) {
449 if (current == &(cec))
return true;
457 case PRMObject::prm_type::PRM_INTERFACE: {
458 if (__implements !=
nullptr) {
462 if (__implements->exists(
466 for (
const auto impl : *__implements)
467 if (impl->isSubTypeOf(i))
return true;
479 template <
typename GUM_SCALAR >
481 const std::string& head_name) {
486 tail = __nameMap[tail_name];
487 head = __nameMap[head_name];
490 "tail and/or head of arc does not exists in this Class");
496 "a PRMReferenceSlot<GUM_SCALAR> can " 497 "not on neither side of an arc");
503 "illegal insertion of an arc between two SlotChain<GUM_SCALAR>");
506 if (!__dag.existsArc(
Arc(tail->
id(), head->
id()))) {
507 __dag.addArc(tail->
id(), head->
id());
510 "duplicate arc " << tail_name <<
"->" << head_name);
513 get(tail->
id()).addChild(
get(head->
id()));
514 get(head->
id()).addParent(
get(tail->
id()));
520 this->setInputNode(*head,
true);
521 sc->
end().setOutputNode(sc->
end().get(sc->
lastElt().safeName()),
true);
525 template <
typename GUM_SCALAR >
529 for (
auto i : implements()) {
530 if (i->exists(elt->
name())) { __checkInterface(elt, i); }
537 template <
typename GUM_SCALAR >
541 const auto& i_elt = i->
get(elt->
name());
545 if (!(is_attr || is_agg)) {
549 if (!elt->
type().isSubTypeOf(i_elt.type())) {
551 "Attribute type does not respect class interface");
554 if (elt->
type() != i_elt.type()) {
555 if (!this->exists(i_elt.safeName())) {
557 "Attribute type does not respect class interface");
559 elt = &(this->
get(i_elt.safeName()));
563 if (!__dag.existsNode(i_elt.id())) {
568 if (elt->
id() != i_elt.id()) {
570 for (
auto child : __dag.children(elt->
id())) {
571 __dag.addArc(i_elt.id(), child);
573 __dag.eraseNode(elt->
id());
575 __nodeIdMap.erase(elt->
id());
576 elt->
setId(i_elt.id());
577 __nodeIdMap.insert(elt->
id(), elt);
580 template <
typename GUM_SCALAR >
584 for (
auto i : implements()) {
585 if (i->exists(ref->
name())) { __checkRefInterface(ref, i); }
592 template <
typename GUM_SCALAR >
595 auto& i_elt = i->
get(ref->
name());
596 if (i_elt.elt_type() != ref->
elt_type()) {
600 if (!ref->
slotType().isSubTypeOf(i_ref.slotType())) {
602 "ReferenceSlot type does not respect class interface");
605 if (!__dag.exists(i_ref.id())) {
607 "class " << this->name() <<
" does not respect interface " 608 << i->
name() <<
" implementation");
611 if (ref->
id() != i_ref.id()) { __dag.eraseNode(ref->
id()); }
612 __nodeIdMap.erase(ref->
id());
613 ref->
setId(i_ref.id());
614 __nodeIdMap.insert(ref->
id(), ref);
617 template <
typename GUM_SCALAR >
619 if (__nameMap.exists(elt->
name())) {
621 "name " << elt->
name()
622 <<
" already used by another ClassElement");
626 __dag.addNodeWithId(elt->
id());
627 __nodeIdMap.insert(elt->
id(), elt);
628 __nameMap.insert(elt->
name(), elt);
631 __nameMap.insert(elt->
safeName(), elt);
646 __checkInterfaces(elt);
648 __addIOInterfaceFlags(elt);
658 __checkInterfaces(elt);
660 __addIOInterfaceFlags(elt);
666 __referenceSlots.insert(ref);
669 __checkRefInterfaces(ref);
691 template <
typename GUM_SCALAR >
697 while (parent->type().isSubType()) {
703 for (
auto i : implements()) {
715 __dag.addNodeWithId(child->
id());
717 __nodeIdMap.insert(child->
id(), child);
719 __nameMap.insert(child->
safeName(), child);
720 __attributes.insert(child);
723 __dag.addArc(parent->id(), child->
id());
729 template <
typename GUM_SCALAR >
733 if (!super().exists(overloader->
name())) {
735 "found no ClassElement<GUM_SCALAR> to overload");
739 "overload is possible only with subclasses");
743 if (overloaded == overloader) {
745 "dupplicate ClassElement " << overloader->
name());
748 if (!__checkOverloadLegality(overloaded, overloader)) {
754 auto overloader_attr =
756 auto overloaded_attr =
758 __overloadAttribute(overloader_attr, overloaded_attr);
759 __addIOInterfaceFlags(overloader);
766 __addIOInterfaceFlags(overloader);
773 auto overloader_ref =
775 auto overloaded_ref =
777 __overloadReference(overloader_ref, overloaded_ref);
783 "SlotChain<GUM_SCALAR> can not be overloaded");
788 auto overloaded_param =
790 auto overloader_param =
792 __overloadParameter(overloader_param, overloaded_param);
800 return overloader->
id();
803 template <
typename GUM_SCALAR >
807 __dag.eraseParents(overloaded->
id());
810 if (overloader->
type() != overloaded->
type()) {
812 __dag.addNodeWithId(overloader->
id());
813 __nodeIdMap.insert(overloader->
id(), overloader);
814 __nameMap[overloader->
name()] = overloader;
815 __nameMap.insert(overloader->
safeName(), overloader);
816 __attributes.insert(overloader);
817 __addCastDescendants(overloader, overloaded);
819 overloader->
setId(overloaded->
id());
820 __nodeIdMap[overloader->
id()] = overloader;
821 __nameMap[overloader->
name()] = overloader;
822 __nameMap[overloader->
safeName()] = overloader;
823 __attributes.erase(overloaded);
824 __attributes.insert(overloader);
830 template <
typename GUM_SCALAR >
835 overloader->
setId(overloaded->
id());
836 __nodeIdMap[overloader->
id()] = overloader;
837 __nameMap[overloader->
name()] = overloader;
838 __nameMap.insert(overloader->
safeName(), overloader);
839 __referenceSlots.insert(overloader);
843 std::vector< PRMSlotChain< GUM_SCALAR >* > toRemove, toAdd;
846 for (
const auto slotchain : __slotChains) {
851 if ((slotchain->chain().atPos(0) == overloaded)) {
855 auto elt = ++(slotchain->chain().begin());
857 while (elt != slotchain->chain().end()) {
859 next = &(ref->
slotType().get((*elt)->name()));
868 if (seq.
back()->type() != slotchain->lastElt().type()) {
872 .get(slotchain->lastElt().safeName())));
874 std::string dot =
".";
876 for (
Size i = 0; i < seq.
size() - 1; ++i) {
877 sc_name += seq.
atPos(i)->name() + dot;
880 sc_name += seq.
back()->safeName();
882 sc->
setId(slotchain->id());
884 for (
const auto child : this->containerDag().children(sc->
id())) {
885 auto& elt =
get(child);
888 auto& old_type = slotchain->lastElt().
type();
889 auto& new_type = sc->
lastElt().type();
890 attr.swap(old_type, new_type);
900 toRemove.push_back(slotchain);
903 slotchain->chain().setAtPos(0, overloader);
908 for (
const auto torem : toRemove) {
909 __nameMap.erase(torem->name());
910 __slotChains.erase(torem);
914 for (
const auto toadd : toAdd) {
915 __nameMap.insert(toadd->name(), toadd);
916 __nodeIdMap[toadd->id()] = toadd;
917 __slotChains.insert(sc);
921 __referenceSlots.erase(overloaded);
922 __nameMap.erase(overloaded->
safeName());
926 template <
typename GUM_SCALAR >
930 overloader->
setId(overloaded->
id());
931 __nodeIdMap[overloader->
id()] = overloader;
932 __nameMap[overloader->
name()] = overloader;
933 __nameMap[overloader->
safeName()] = overloader;
934 __parameters.erase(overloaded);
935 __parameters.insert(overloader);
939 template <
typename GUM_SCALAR >
945 while (parent->
type().superType() != end->
type()) {
948 __nodeIdMap.insert(child->
id(), child);
949 __dag.addNodeWithId(child->
id());
951 __nameMap.insert(child->
safeName(), child);
952 __attributes.insert(child);
953 __addIOInterfaceFlags(child);
956 __dag.addArc(parent->
id(), child->
id());
961 __dag.addArc(parent->
id(), end->
id());
964 template <
typename GUM_SCALAR >
967 for (
auto ext : __extensions) {
973 template <
typename GUM_SCALAR >
977 if (__implements !=
nullptr) {
978 for (
const auto impl : *__implements) {
983 if (impl->exists(elt->
name())) {
985 this->_getIOFlag(*elt).second =
true;
987 this->_setIOFlag(*elt, std::make_pair(
false,
true));
991 super = &(super->
super());
992 }
catch (
NotFound&) { super =
nullptr; }
998 template <
typename GUM_SCALAR >
1009 template <
typename GUM_SCALAR >
1011 return PRMObject::prm_type::CLASS;
1014 template <
typename GUM_SCALAR >
1019 template <
typename GUM_SCALAR >
1024 template <
typename GUM_SCALAR >
1027 return *(__nodeIdMap[id]);
1033 template <
typename GUM_SCALAR >
1037 return *(__nodeIdMap[id]);
1040 "no ClassElement<GUM_SCALAR> with the given NodeId (" <<
id 1045 template <
typename GUM_SCALAR >
1049 return *(__nameMap[name]);
1052 "no ClassElement<GUM_SCALAR> with the given name (" << name
1057 template <
typename GUM_SCALAR >
1061 return *(__nameMap[name]);
1064 "no ClassElement<GUM_SCALAR> with the given name (" << name
1069 template <
typename GUM_SCALAR >
1072 return __attributes;
1075 template <
typename GUM_SCALAR >
1078 return __parameters;
1082 template <
typename GUM_SCALAR >
1091 prefix(s + ref.name() +
"."),
1092 c(static_cast< const
PRMClass< GUM_SCALAR >* >(&(ref.slotType()))),
1096 template <
typename GUM_SCALAR >
1101 for (
const auto p : parameters()) {
1102 params.
insert(p->name(), p);
1105 std::queue< ParamScopeData< GUM_SCALAR > > queue;
1107 for (
const auto ref : referenceSlots()) {
1108 if (PRMObject::isClass(ref->slotType())) {
1113 while (!queue.empty()) {
1114 auto data = queue.front();
1117 if (data.depth < 5) {
1118 for (
const auto p : data.c->parameters()) {
1119 params.
insert(data.prefix + p->name(), p);
1122 for (
const auto ref : data.c->referenceSlots()) {
1123 if (PRMObject::isClass(ref->slotType())) {
1130 GUM_TRACE(
"Depth limit reached when looking up parameters");
1137 template <
typename GUM_SCALAR >
1140 return __aggregates;
1143 template <
typename GUM_SCALAR >
1146 return __referenceSlots;
1149 template <
typename GUM_SCALAR >
1152 return __slotChains;
1155 template <
typename GUM_SCALAR >
1158 return *__superClass;
1164 template <
typename GUM_SCALAR >
1168 return *__implements;
1171 "this Class does not implement any Interface<GUM_SCALAR>");
1175 template <
typename GUM_SCALAR >
1181 template <
typename GUM_SCALAR >
1187 template <
typename GUM_SCALAR >
1193 template <
typename GUM_SCALAR >
1199 template <
typename GUM_SCALAR >
1203 __nameMap.insert(overloader->
safeName(), overloader);
1204 __aggregates.insert(overloader);
1207 template <
typename GUM_SCALAR >
1215 if (!overloader->
type().isSubTypeOf(overloaded->
type())) {
1222 const auto& new_slot_type =
1225 const auto& old_slot_type =
1229 if (!new_slot_type.isSubTypeOf(old_slot_type)) {
return false; }
1235 auto overloaded_param =
1237 auto overloader_param =
1244 default: {
return false; }
1249 template <
typename GUM_SCALAR >
1252 return __extensions;
1255 template <
typename GUM_SCALAR >
1257 __extensions.insert(c);
1260 template <
typename GUM_SCALAR >
1262 const std::string& safe_name)
const {
1266 return elt.
type().name() ==
get(elt.
name()).type().name();
1272 template <
typename GUM_SCALAR >
1276 if (!this->_getIOFlag(elt).second) {
1278 for (
auto i : *__implements) {
1279 if (i->isOutputNode(elt)) {
return true; }
1283 if (__superClass && (__superClass->isOutputNode(elt))) {
return true; }
void insert(const T1 &first, const T2 &second)
Inserts a new association in the gum::Bijection.
PRMParameter is a member of a Class in a PRM.
PRMClass< GUM_SCALAR > * __superClass
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this...
virtual PRMAttribute< GUM_SCALAR > * getCastDescendant() const =0
Returns a proper cast descendant of this PRMAttribute.
const std::string & name() const
Returns the name of this object.
const PRMClass< GUM_SCALAR > * c
Size size() const noexcept
Returns the size of the sequence.
virtual PRMType & type()=0
See gum::PRMClassElement::type().
Headers of gum::prm::Class<GUM_SCALAR>.
The generic class for storing (ordered) sequences of objects.
virtual prm_type obj_type() const =0
Returns the type of this object.
Abstract class representing an element of PRM class.
Set< PRMReferenceSlot< GUM_SCALAR > *> __referenceSlots
The sequence of PRMReferenceSlot<GUM_SCALAR>.
Base class for discrete random variable.
Set< PRMAggregate< GUM_SCALAR > *> __aggregates
The sequence of aggregate.
virtual PRMType & type()
This is similar to the following call: this->lastElt().type()
gum is the global namespace for all aGrUM entities
Headers of gum::prm::PRMInterface.
void setLabel(Idx idx)
Set the aggregator's label.
A PRMReferenceSlot represent a relation between two PRMClassElementContainer.
PRMClassElementContainer< GUM_SCALAR > & slotType()
Returns the type of this slot, which is a PRMClassElementContainer (it is not the type of PRMObject)...
The class for generic Hash Tables.
void _findAllSubtypes(Set< PRMClassElementContainer< GUM_SCALAR > * > &set)
Fills set with all the subtypes of this Class<GUM_SCALAR>.
Set< PRMSlotChain< GUM_SCALAR > *> __slotChains
The set of gum::PRMSlotChain<GUM_SCALAR>s.
virtual PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const
Implementation of the pure virtual method of PRMObject.
Set< PRMInterface< GUM_SCALAR > *> * __implements
The Set of implemented interface of this.
Representation of a setA Set is a structure that contains arbitrary elements.
const std::string & safeName() const
Returns the safe name of this PRMClassElement, if any.
std::shared_ptr< Idx > sharedLabel() const
Returns the shared_ptr holding this Aggregate label.
prm_type
Enumeration of the different types of objects handled by a PRM.
virtual void overload(PRMAttribute< GUM_SCALAR > *source)
Set this as overload of source (necessayr to preserver internal pointers for MultiDims).
The base class for all directed edgesThis class is used as a basis for manipulating all directed edge...
PRMClass(const std::string &name)
Default constructor.
ParamScopeData(const std::string &s, const PRMReferenceSlot< GUM_SCALAR > &ref, Idx d)
PRMClassElementContainer< GUM_SCALAR > & end()
Returns the PRMClassElement<GUM_SCALAR>Container over which this slot chain ends. ...
Base class for all aGrUM's exceptions.
Set of pairs of elements with fast search for both elements.
An PRMInterface is implemented by a Class<GUM_SCALAR> and defines a set of PRMReferenceSlot<GUM_SCALA...
virtual ClassElementType elt_type() const =0
Return the type of class element this object is.
virtual PRMType & type()=0
Return a reference over the gum::PRMType of this class element.
A PRMSlotChain represents a sequence of gum::prm::PRMClassElement<GUM_SCALAR> where the n-1 first gum...
PRMInterface< GUM_SCALAR > & super()
Returns the superInterface of this PRMInterface.
NodeId nextNodeId()
Returns the next value of an unique counter for PRM's node id.
virtual PRMType & type()
See gum::PRMClassElement::type().
void erase(const Key &k)
Remove an element from the sequence.
virtual PRMClassElement< GUM_SCALAR > & get(NodeId id)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
<agrum/PRM/classElementContainer.h>
NodeId id() const
Returns the NodeId of this element in it's class DAG.
virtual void setId(NodeId id)
Used to assign the id of this element.
A PRMClass is an object of a PRM representing a fragment of a Bayesian Network which can be instantia...
virtual void setAsCastDescendant(PRMAttribute< GUM_SCALAR > *attr)=0
Define attr as a cast descendant of this PRMAttribute.
void __addExtension(PRMClass< GUM_SCALAR > *c)
This method is called when a sub-Class<GUM_SCALAR> of this Class<GUM_SCALAR> is created.
Size Idx
Type for indexes.
ParameterType valueType() const
See gum::PRMClassElement::elt_type().
virtual void copyCpf(const Bijection< const DiscreteVariable *, const DiscreteVariable * > &bif, const PRMAttribute< GUM_SCALAR > &source)=0
See gum::PRMClassElement::elt_type().
Set< PRMAttribute< GUM_SCALAR > *> __attributes
The sequence of PRMAttribute<GUM_SCALAR>s.
PRMAttribute is a member of a Class in a PRM.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
PRMClassElement< GUM_SCALAR > & lastElt()
Returns the last element of the slot chain, typically this is an gum::PRMAttribute or a gum::PRMAggre...
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
HashTable< std::string, PRMClassElement< GUM_SCALAR > *> __nameMap
Mapping between a member's name and itself. Used for fast access to a member given it's name...
virtual const DAG & containerDag() const
Returns the gum::DAG of this PRMClassElementContainer.
void setAtPos(Idx i, const Key &newKey)
Change the value.
Size NodeId
Type for node ids.
void insert(const Key &k)
Inserts a new element into the set.
const Key & back() const
Returns the last element of the sequence.
#define GUM_ERROR(type, msg)
const Key & atPos(Idx i) const
Returns the object at the pos i.
Set< PRMParameter< GUM_SCALAR > *> __parameters
The Set of parameters in this Class<GUM_SCALAR>.
void insert(const Key &k)
Insert an element at the end of the sequence.