SOFA API  c4ac86de
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

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

Attribute details

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

Constructor details

sofa::core::objectmodel::Tag::Tag ( )
inline
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.

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

This constructor should be used only if really necessary.

Function details

bool sofa::core::objectmodel::Tag::negative ( ) const
inline
sofa::core::objectmodel::Tag::operator std::string ( ) const

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

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

Related details

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