|
INET Framework for OMNeT++/OMNEST
|
This class maintains a set of tags. More...
#include <SharingTagSet.h>
Public Member Functions | |
Constructors and operators | |
| SharingTagSet () | |
| SharingTagSet (const SharingTagSet &other) | |
| SharingTagSet (SharingTagSet &&other) | |
| SharingTagSet & | operator= (const SharingTagSet &other) |
| SharingTagSet & | operator= (SharingTagSet &&other) |
| virtual void | parsimPack (cCommBuffer *buffer) const override |
| virtual void | parsimUnpack (cCommBuffer *buffer) override |
Type independent functions | |
| int | getNumTags () const |
| Returns the number of tags. More... | |
| const Ptr< const TagBase > & | getTag (int index) const |
| Returns the shared tag at the given index. More... | |
| const Ptr< TagBase > | getTagForUpdate (int index) |
| Returns the exclusively owned tag at the given index for update. More... | |
| void | clearTags () |
| Clears the set of tags. More... | |
| void | copyTags (const SharingTagSet &other) |
| Copies the set of tags from the other set. More... | |
Type dependent functions | |
| template<typename T > | |
| const Ptr< const T > | findTag () const |
| Returns the shared tag of the provided type, or returns nullptr if no such tag is present. More... | |
| template<typename T > | |
| const Ptr< T > | findTagForUpdate () |
| Returns the exclusively owned tag of the provided type for update, or returns nullptr if no such tag is present. More... | |
| template<typename T > | |
| const Ptr< const T > | getTag () const |
| Returns the shared tag of the provided type, or throws an exception if no such tag is present. More... | |
| template<typename T > | |
| const Ptr< T > | getTagForUpdate () |
| Returns the exclusively owned tag of the provided type for update, or throws an exception if no such tag is present. More... | |
| template<typename T > | |
| const Ptr< T > | addTag () |
| Returns a newly added exclusively owned tag of the provided type for update, or throws an exception if such a tag is already present. More... | |
| template<typename T > | |
| const Ptr< T > | addTagIfAbsent () |
| Returns a newly added exclusively owned tag of the provided type if absent, or returns the exclusively owned tag that is already present for update. More... | |
| template<typename T > | |
| const Ptr< T > | removeTag () |
| Removes the tag of the provided type and returns it for update, or throws an exception if no such tag is present. More... | |
| template<typename T > | |
| const Ptr< T > | removeTagIfPresent () |
| Removes the tag of the provided type if present and returns it for update, or returns nullptr if no such tag is present. More... | |
Protected Member Functions | |
| void | setTag (int index, const Ptr< const TagBase > &tag) |
| void | addTag (const Ptr< const TagBase > &tag) |
| const Ptr< TagBase > | removeTag (int index) |
| int | getTagIndex (const std::type_info &typeInfo) const |
| template<typename T > | |
| int | getTagIndex () const |
| void | ensureTagsVectorAllocated () |
| void | prepareTagsVectorForUpdate () |
Protected Attributes | |
| Ptr< SharedVector< Ptr< const TagBase > > > | tags |
| Both the vector and the individual tags can be shared among different instances of this class. More... | |
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. Tags are shared between other instances of this class. Tags can be changed with a copy-on-write mechanism.
|
inline |
|
inline |
|
inline |
|
inline |
Returns a newly added exclusively owned tag of the provided type for update, or throws an exception if such a tag is already present.
Referenced by addTagIfAbsent(), and parsimUnpack().
|
protected |
|
inline |
Returns a newly added exclusively owned tag of the provided type if absent, or returns the exclusively owned tag that is already present for update.
|
inline |
|
inline |
Copies the set of tags from the other set.
|
protected |
|
inline |
Returns the shared tag of the provided type, or returns nullptr if no such tag is present.
Referenced by inet::SctpNatServer::handleMessage(), inet::SctpPeer::handleMessage(), inet::SctpNatPeer::handleMessage(), inet::SctpServer::makeReceiveRequest(), inet::SctpPeer::socketDataNotificationArrived(), and inet::SctpNatPeer::socketDataNotificationArrived().
|
inline |
Returns the exclusively owned tag of the provided type for update, or returns nullptr if no such tag is present.
|
inline |
Returns the number of tags.
Referenced by inet::Packet::forEachChild(), and parsimPack().
|
inline |
Returns the shared tag of the provided type, or throws an exception if no such tag is present.
Referenced by findTag(), and getTagForUpdate().
|
inline |
Returns the shared tag at the given index.
The index must be in the range [0, getNumTags()).
Referenced by inet::Packet::forEachChild().
|
inline |
Returns the exclusively owned tag of the provided type for update, or throws an exception if no such tag is present.
Referenced by findTagForUpdate(), and removeTag().
|
inline |
Returns the exclusively owned tag at the given index for update.
The index must be in the range [0, getNumTags()).
|
inlineprotected |
|
protected |
|
inline |
Referenced by copyTags().
|
inline |
|
overridevirtual |
Referenced by inet::Packet::parsimPack().
|
overridevirtual |
Referenced by inet::Packet::parsimUnpack().
|
protected |
Referenced by addTag(), getTagForUpdate(), and removeTag().
|
inline |
Removes the tag of the provided type and returns it for update, or throws an exception if no such tag is present.
Referenced by removeTagIfPresent().
|
protected |
|
inline |
Removes the tag of the provided type if present and returns it for update, or returns nullptr if no such tag is present.
|
inlineprotected |
Referenced by getTagForUpdate().
|
protected |
Both the vector and the individual tags can be shared among different instances of this class.
Referenced by addTag(), clearTags(), ensureTagsVectorAllocated(), getNumTags(), getTag(), getTagIndex(), operator=(), parsimPack(), prepareTagsVectorForUpdate(), and removeTag().