Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
trax::Identified< I > Struct Template Referenceabstract

Interface for identifying objects by ID or reference values. More...

#include <C:/Trend/Development/Trax3/Code/trax/Identified.h>

Inheritance diagram for trax::Identified< I >:

Public Member Functions

virtual const std::string & Reference (const std::string &name) const =0
 Gets a reference that was set for this object by name.
virtual void Reference (const std::string &name, const std::string &reference)=0
 Sets the reference for the object.
virtual const std::vector< char const * > & ReferenceNames (const std::string &namePart) const =0
 Searches for all reference names that countain namePart as substring in the name.
virtual IDType ID () const noexcept=0
virtual void ID (IDType id) noexcept=0
 Sets the object's id.
 Identified (const Identified &)=delete
Identified & operator= (const Identified &)=delete

Protected Member Functions

 Identified (Identified &&)=default
Identified & operator= (Identified &&)=default

Detailed Description

template<class I>
struct trax::Identified< I >

Interface for identifying objects by ID or reference values.

The template argument prevents that this becomes a common base.

Member Function Documentation

◆ ID() [1/2]

◆ ID() [2/2]

template<class I>
virtual void trax::Identified< I >::ID ( IDType id)
pure virtualnoexcept

Sets the object's id.

Collections will typically set the id of an object added to them if id is not set. If the id of an object has a certain value, the collection will try to use that value but will fail if it is not unique.

◆ Reference() [1/2]

template<class I>
virtual const std::string & trax::Identified< I >::Reference ( const std::string & name) const
pure virtual

Gets a reference that was set for this object by name.

Parameters
nameName of the reference.
Returns
a reference string for additional data to the object.

Implemented in trax::Plug_Imp, and trax::Sensor_Imp.

◆ Reference() [2/2]

template<class I>
virtual void trax::Identified< I >::Reference ( const std::string & name,
const std::string & reference )
pure virtual

Sets the reference for the object.

Parameters
nameName of the reference.
referenceReference string to be set.

The documentation for this struct was generated from the following file: