osgEarth 2.1.1
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions

osgEarth::Symbology::Taggable< T > Class Template Reference

List of all members.

Public Member Functions

void addTag (const std::string &tag)
void addTags (const TagVector &tags)
void addTags (const std::string &tagString)
void removeTag (const std::string &tag)
bool containsTag (const std::string &tag) const
bool containsTags (const TagSet &tags) const
bool containsTags (const TagVector &tags) const
const TagSettags () const
std::string tagString () const

Static Public Member Functions

static std::string tagString (const TagSet &tags)
static std::string tagString (const TagVector &tags)

Protected Attributes

TagSet _tags

Private Member Functions

std::string normalize (const std::string &input) const

Detailed Description

template<typename T>
class osgEarth::Symbology::Taggable< T >

Definition at line 35 of file Tags.


Member Function Documentation

template<typename T>
void osgEarth::Symbology::Taggable< T >::addTag ( const std::string &  tag) [inline]

Definition at line 38 of file Tags.

                                            {
            _tags.insert( normalize( tag ) );
        }
template<typename T>
void osgEarth::Symbology::Taggable< T >::addTags ( const TagVector tags) [inline]

Definition at line 41 of file Tags.

                                              {
            for( TagVector::const_iterator i = tags.begin(); i != tags.end(); ++i )
                _tags.insert( normalize(*i) );
        }

Here is the caller graph for this function:

template<typename T>
void osgEarth::Symbology::Taggable< T >::addTags ( const std::string &  tagString) [inline]

Definition at line 45 of file Tags.

                                                   {
            TagVector tags;
            StringTokenizer( tagString, tags, " ", "\"'", false, true );
            addTags( tags );
        }
template<typename T>
bool osgEarth::Symbology::Taggable< T >::containsTag ( const std::string &  tag) const [inline]

Definition at line 53 of file Tags.

                                                       {
            return _tags.find( normalize( tag )) != _tags.end();
        }
template<typename T>
bool osgEarth::Symbology::Taggable< T >::containsTags ( const TagSet tags) const [inline]

Definition at line 57 of file Tags.

                                                     {
            for( TagSet::const_iterator i = tags.begin(); i != tags.end(); i++ ) {
               if ( _tags.find( normalize( *i ) ) == _tags.end() )
                  return false;
            }
            return true;            
        }

Here is the caller graph for this function:

template<typename T>
bool osgEarth::Symbology::Taggable< T >::containsTags ( const TagVector tags) const [inline]

Definition at line 65 of file Tags.

                                                        {
            for( TagVector::const_iterator i = tags.begin(); i != tags.end(); i++ ) {
               if ( _tags.find( normalize( *i ) ) == _tags.end() )
                  return false;
            }
            return true;            
        }
template<typename T>
std::string osgEarth::Symbology::Taggable< T >::normalize ( const std::string &  input) const [inline, private]

Definition at line 105 of file Tags.

                                                            {
            std::string output = input;
            std::transform( output.begin(), output.end(), output.begin(), tolower );
            return output;
        }

Here is the caller graph for this function:

template<typename T>
void osgEarth::Symbology::Taggable< T >::removeTag ( const std::string &  tag) [inline]

Definition at line 50 of file Tags.

                                               {
            _tags.erase( normalize( tag ) );
        }
template<typename T>
const TagSet& osgEarth::Symbology::Taggable< T >::tags ( ) const [inline]

Definition at line 73 of file Tags.

{ return _tags; }

Here is the caller graph for this function:

template<typename T>
static std::string osgEarth::Symbology::Taggable< T >::tagString ( const TagSet tags) [inline, static]

Definition at line 75 of file Tags.

                                                       {
            std::stringstream buf;
            for( TagSet::const_iterator i = tags.begin(); i != tags.end(); i++ )
                buf << (i != tags.begin()? " " : "") << *i;
            std::string result = buf.str();
            return result;
        }
template<typename T>
static std::string osgEarth::Symbology::Taggable< T >::tagString ( const TagVector tags) [inline, static]

Definition at line 83 of file Tags.

                                                          {
            std::stringstream buf;
            for( TagVector::const_iterator i = tags.begin(); i != tags.end(); i++ )
                buf << (i != tags.begin()? " " : "") << *i;
            std::string result = buf.str();
            return result;
        }
template<typename T>
std::string osgEarth::Symbology::Taggable< T >::tagString ( ) const [inline]

Definition at line 91 of file Tags.

                                    {
            std::stringstream buf;
            for( TagSet::const_iterator i = _tags.begin(); i != _tags.end(); i++ )
                buf << (i != _tags.begin()? " " : "") << *i;
            std::string result = buf.str();
            return result;
        }

Member Data Documentation

template<typename T>
TagSet osgEarth::Symbology::Taggable< T >::_tags [protected]

Definition at line 101 of file Tags.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines