29 #ifndef GUM_INTERFACE_H 30 #define GUM_INTERFACE_H 36 #include <agrum/agrum.h> 37 #include <agrum/tools/core/sequence.h> 38 #include <agrum/tools/core/set.h> 40 #include <agrum/PRM/elements/PRMClassElement.h> 41 #include <agrum/PRM/elements/PRMClassElementContainer.h> 42 #include <agrum/PRM/elements/PRMAttribute.h> 43 #include <agrum/PRM/elements/PRMReferenceSlot.h> 44 #include <agrum/PRM/elements/PRMScalarAttribute.h> 50 template <
typename GUM_SCALAR >
65 template <
typename GUM_SCALAR >
90 bool delayInheritance =
false);
105 virtual typename PRMObject::prm_type
obj_type()
const;
122 void addArc(
const std::string& tail,
const std::string& head);
130 virtual bool isOutputNode(
const PRMClassElement< GUM_SCALAR >& elt)
const;
220 virtual bool isSubTypeOf(
const PRMClassElementContainer< GUM_SCALAR >& cec)
const;
371 const PRMClassElement< GUM_SCALAR >* overloader);
374 PRMAttribute< GUM_SCALAR >* overloaded);
377 PRMReferenceSlot< GUM_SCALAR >* overloaded);
385 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 393 #include <agrum/PRM/elements/PRMInterface_tpl.h> bool _checkOverloadLegality_(const PRMClassElement< GUM_SCALAR > *overloaded, const PRMClassElement< GUM_SCALAR > *overloader)
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this...
const DAG & dag_() const
Returns a constant reference over this PRMInterface's DAG.
const const_ClassEltIterator & end() const
virtual PRMClassElement< GUM_SCALAR > & get(const std::string &name)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
PRMInterface< GUM_SCALAR > * _superInterface_
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this...
const PRMClassElement< GUM_SCALAR > & operator[](NodeId id) const
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).
virtual bool isSubTypeOf(const PRMClassElementContainer< GUM_SCALAR > &cec) const
Test if this PRMInterface is a sub PRMInterface of cec.
void _inheritInterface_(const PRMInterface< GUM_SCALAR > &i)
Proceed with the copy of i in this.
Set< PRMClass< GUM_SCALAR > *> & implementations()
Returns the set of Class<GUM_SCALAR> implementing this PRMInterface.
PRMInterface(const PRMInterface< GUM_SCALAR > &source)
Copy constructor.
PRMInterface(const std::string &name, PRMInterface< GUM_SCALAR > &super, bool delayInheritance=false)
Constructor for building a subclass of super.
NodeId add(PRMClassElement< GUM_SCALAR > *elt)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::add(PRMClassElement<GUM_SCALAR>*).
const PRMInterface< GUM_SCALAR > & super() const
Returns the superInterface of this PRMInterface.
INLINE void emplace(Args &&... args)
void _addImplementation_(PRMClass< GUM_SCALAR > *c)
Add an Class<GUM_SCALAR> to the set of Class<GUM_SCALAR> which implements this PRMInterface.
const Set< PRMSlotChain< GUM_SCALAR > *> & slotChains() const
Returns the set of PRMSlotChain<GUM_SCALAR> of this Class<GUM_SCALAR>.
void _overloadAttribute_(PRMAttribute< GUM_SCALAR > *overloader, PRMAttribute< GUM_SCALAR > *overloaded)
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this...
Set< PRMClass< GUM_SCALAR > *> _implementations_
The set of Class<GUM_SCALAR> which implements this PRMInterface.
NodeId overload(PRMClassElement< GUM_SCALAR > *elt)
Add a new PRMClassElement<GUM_SCALAR> which overload an inherited PRMClassElement<GUM_SCALAR>.
const_ClassEltIterator begin() const
virtual const PRMClassElement< GUM_SCALAR > & get(const std::string &name) const
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
virtual ~PRMInterface()
Destructor.
DAG & dag_()
Returns a non constant reference over this PRMInterface's DAG.
const PRMClassElement< GUM_SCALAR > & operator[](const std::string &name) const
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const std::string&).
void _overloadReferenceSlot_(PRMReferenceSlot< GUM_SCALAR > *overloader, PRMReferenceSlot< GUM_SCALAR > *overloaded)
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this...
void _addCastDescendants_(PRMAttribute< GUM_SCALAR > *start, PRMAttribute< GUM_SCALAR > *end)
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this...
virtual bool isOutputNode(const PRMClassElement< GUM_SCALAR > &elt) const
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
void addArc(const std::string &tail, const std::string &head)
An Interfance doesn't have any arc, this will raise an OperationNotAllowed exception.
ParamScopeData(const std::string &s, const PRMReferenceSlot< GUM_SCALAR > &ref, Idx d)
PRMInterface(const std::string &name)
Default constructor.
const Set< PRMReferenceSlot< GUM_SCALAR > *> & referenceSlots() const
Returns the set of PRMAggregate of this Class<GUM_SCALAR>.
PRMClassElement< GUM_SCALAR > & operator[](const std::string &name)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const std::string&).
void _addExtension_(PRMInterface< GUM_SCALAR > *c)
Add an Class<GUM_SCALAR> to the set of Class<GUM_SCALAR> which implements this PRMInterface.
PRMInterface< GUM_SCALAR > & super()
Returns the superInterface of this PRMInterface.
DAG _dag_
The dag representing dependencies between formal attributes and slots.
PRMInterface< GUM_SCALAR > & operator=(const PRMInterface< GUM_SCALAR > &source)
Copy operator. Don't use it.
void inheritInterface()
Inherits from this interface super interface, this should only be done when this inteface inheritance...
virtual PRMClassElement< GUM_SCALAR > & get(NodeId id)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
virtual const PRMClassElement< GUM_SCALAR > & get(NodeId id) const
Se gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
void updateDescendants_(const PRMClassElement< GUM_SCALAR > &elt)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>(const PRMClassElement<GUM_SCALAR>&).
const ClassEltIterator & end()
const Set< PRMClass< GUM_SCALAR > *> & implementations() const
Returns the set of Class<GUM_SCALAR> implementing this PRMInterface.
void findAllSubtypes_(Set< PRMClassElementContainer< GUM_SCALAR > * > &set)
Fills set with all the subtypes of this PRMInterface, this includes extensions and implementations...
PRMClassElement< GUM_SCALAR > & operator[](NodeId id)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).
Set< PRMInterface< GUM_SCALAR > *> _extensions_
The set of Class<GUM_SCALAR> which implements this PRMInterface.