|
INET Framework for OMNeT++/OMNEST
|
This class maintains a set of tags. More...
#include <TagSet.h>
Public Member Functions | |
| TagSet () | |
| TagSet (const TagSet &other) | |
| TagSet (TagSet &&other) | |
| ~TagSet () | |
| TagSet & | operator= (const TagSet &other) |
| TagSet & | operator= (TagSet &&other) |
| int | getNumTags () const |
| Returns the number of tags. More... | |
| cObject * | getTag (int index) const |
| Returns the tag at the given index. More... | |
| void | clearTags () |
| Clears the set of tags. More... | |
| void | copyTags (const TagSet &other) |
| Copies the set of tags from the other set. More... | |
| template<typename T > | |
| const T * | findTag () const |
| Returns the tag for the provided type, or returns nullptr if no such tag is present. More... | |
| template<typename T > | |
| T * | findTagForUpdate () |
| Returns the tag of the provided type for update, or returns nullptr if no such tag is present. More... | |
| template<typename T > | |
| const T * | getTag () const |
| Returns the tag for the provided type, or throws an exception if no such tag is present. More... | |
| template<typename T > | |
| T * | getTagForUpdate () |
| Returns the tag of the provided type for update, or throws an exception if no such tag is present. More... | |
| template<typename T > | |
| T * | addTag () |
| Returns a newly added tag for the provided type, or throws an exception if such a tag is already present. More... | |
| template<typename T > | |
| T * | addTagIfAbsent () |
| Returns a newly added tag for the provided type if absent, or returns the tag that is already present. More... | |
| template<typename T > | |
| T * | removeTag () |
| Removes the tag for the provided type, or throws an exception if no such tag is present. More... | |
| template<typename T > | |
| T * | removeTagIfPresent () |
| Removes the tag for the provided type if present, or returns nullptr if no such tag is present. More... | |
Protected Member Functions | |
| void | ensureAllocated () |
| void | addTag (cObject *tag) |
| cObject * | removeTag (int index) |
| int | getTagIndex (const std::type_info &typeInfo) const |
| template<typename T > | |
| int | getTagIndex () const |
Protected Attributes | |
| std::vector< cObject * > * | tags |
This class maintains a set of tags.
Tags are usually small data strcutures that hold some relevant information. Tags are identified by their type, which means that this class supports adding the same tag type only once. Added tags are exclusively owned by this class and they get deleted with it.
| inet::TagSet::TagSet | ( | ) |
| inet::TagSet::~TagSet | ( | ) |
|
inline |
Returns a newly added tag for the provided type, or throws an exception if such a tag is already present.
Referenced by addTagIfAbsent(), and operator=().
|
protected |
Referenced by inet::NetworkInterface::addProtocolData().
|
inline |
Returns a newly added tag for the provided type if absent, or returns the tag that is already present.
Referenced by inet::NetworkInterface::addProtocolDataIfAbsent().
| void inet::TagSet::clearTags | ( | ) |
Clears the set of tags.
Referenced by inet::NetworkInterface::clearProtocolDataSet(), copyTags(), operator=(), inet::NetworkInterface::resetInterface(), and ~TagSet().
| void inet::TagSet::copyTags | ( | const TagSet & | other | ) |
Copies the set of tags from the other set.
|
protected |
Referenced by addTag(), and operator=().
|
inline |
Returns the tag for the provided type, or returns nullptr if no such tag is present.
Referenced by inet::NetworkInterface::findProtocolData().
|
inline |
Returns the tag of the provided type for update, or returns nullptr if no such tag is present.
Referenced by inet::NetworkInterface::findProtocolDataForUpdate().
|
inline |
Returns the number of tags.
Referenced by inet::NetworkInterface::clearProtocolDataSet(), inet::NetworkInterface::getNumProtocolData(), and inet::NetworkInterface::str().
|
inline |
Returns the tag for the provided type, or throws an exception if no such tag is present.
|
inline |
Returns the tag at the given index.
The index must be in the range [0, getNumTags()).
Referenced by inet::NetworkInterface::clearProtocolDataSet(), inet::NetworkInterface::getProtocolData(), and inet::NetworkInterface::str().
|
inline |
Returns the tag of the provided type for update, or throws an exception if no such tag is present.
Referenced by inet::NetworkInterface::getProtocolDataForUpdate().
|
inlineprotected |
|
protected |
Referenced by TagSet().
|
inline |
Removes the tag for the provided type, or throws an exception if no such tag is present.
Referenced by removeTagIfPresent().
|
protected |
Referenced by inet::NetworkInterface::removeProtocolData().
|
inline |
Removes the tag for the provided type if present, or returns nullptr if no such tag is present.
Referenced by inet::NetworkInterface::removeProtocolDataIfPresent().
|
protected |
Referenced by addTag(), clearTags(), copyTags(), ensureAllocated(), getNumTags(), getTag(), getTagIndex(), operator=(), and removeTag().