SOFA API  98f76541
Open source framework for multi-physics simuation
sofa::core::objectmodel::Tag Class Reference

#include <Tag.h>

A Tag is a string (internally converted to an integer), attached to objects in order to define subsets to process by specific visitors. More...

Detailed Description

A Tag is a string (internally converted to an integer), attached to objects in order to define subsets to process by specific visitors.

Protected Attributes

int id
 

Public Member Functions

 Tag ()
 
 Tag (const std::string &s)
 A tag is constructed from a string and appears like one after, without actually storing a string. More...
 
 Tag (int id)
 This constructor should be used only if really necessary. More...
 
 operator std::string () const
 Any operation requiring a string can be used on a tag using this conversion. More...
 
bool operator== (const Tag &t) const
 
bool operator!= (const Tag &t) const
 
bool operator< (const Tag &t) const
 
bool operator> (const Tag &t) const
 
bool operator<= (const Tag &t) const
 
bool operator>= (const Tag &t) const
 
bool operator! () const
 
bool negative () const
 
Tag operator- () const
 

Friends

SOFA_CORE_API friend std::ostream & operator<< (std::ostream &o, const Tag &t)
 
SOFA_CORE_API friend std::istream & operator>> (std::istream &i, Tag &t)
 

Attribute details

◆ id

int sofa::core::objectmodel::Tag::id
protected

Constructor details

◆ Tag() [1/3]

sofa::core::objectmodel::Tag::Tag ( )
inline

◆ Tag() [2/3]

sofa::core::objectmodel::Tag::Tag ( const std::string &  s)

A tag is constructed from a string and appears like one after, without actually storing a string.

◆ Tag() [3/3]

sofa::core::objectmodel::Tag::Tag ( int  id)
inlineexplicit

This constructor should be used only if really necessary.

Function details

◆ negative()

bool sofa::core::objectmodel::Tag::negative ( ) const
inline

◆ operator std::string()

sofa::core::objectmodel::Tag::operator std::string ( ) const

Any operation requiring a string can be used on a tag using this conversion.

◆ operator!()

bool sofa::core::objectmodel::Tag::operator! ( ) const
inline

◆ operator!=()

bool sofa::core::objectmodel::Tag::operator!= ( const Tag t) const
inline

◆ operator-()

Tag sofa::core::objectmodel::Tag::operator- ( ) const
inline

◆ operator<()

bool sofa::core::objectmodel::Tag::operator< ( const Tag t) const
inline

◆ operator<=()

bool sofa::core::objectmodel::Tag::operator<= ( const Tag t) const
inline

◆ operator==()

bool sofa::core::objectmodel::Tag::operator== ( const Tag t) const
inline

◆ operator>()

bool sofa::core::objectmodel::Tag::operator> ( const Tag t) const
inline

◆ operator>=()

bool sofa::core::objectmodel::Tag::operator>= ( const Tag t) const
inline

Related details

◆ operator<<

SOFA_CORE_API friend std::ostream& operator<< ( std::ostream &  o,
const Tag t 
)
friend

◆ operator>>

SOFA_CORE_API friend std::istream& operator>> ( std::istream &  i,
Tag t 
)
friend