OSVR-Core
Public Member Functions | Protected Attributes | List of all members
osvr::common::RegisteredStringMap Class Reference

Centralize a string registry. More...

#include <RegisteredStringMap.h>

Public Member Functions

OSVR_COMMON_EXPORT util::StringID registerStringID (std::string const &str)
 register new ID with given string and returns StringID. More...
 
OSVR_COMMON_EXPORT util::StringID getStringID (std::string const &str) const
 retrieve the StringID associated with the given string returns an empty util::StringID if it was not found
 
OSVR_COMMON_EXPORT std::string getStringFromId (util::StringID id) const
 retrieve the name of the string given the ID returns empty string if nothing found More...
 
OSVR_COMMON_EXPORT bool isModified () const
 Has a new entry been added since the flag was last cleared?
 
OSVR_COMMON_EXPORT void clearModifiedFlag ()
 Clear the modified flag.
 
OSVR_COMMON_EXPORT void printCurrentMap ()
 helper function to print size and contents of the map
 
OSVR_COMMON_EXPORT std::vector< std::string > getEntries () const
 

Protected Attributes

std::vector< std::string > m_regEntries
 
bool m_modified = false
 special flag that gets switched whenever new element is inserted;
 

Detailed Description

Centralize a string registry.

Basically, the server side, and part of the client side internals.

Member Function Documentation

§ getStringFromId()

std::string osvr::common::RegisteredStringMap::getStringFromId ( util::StringID  id) const

retrieve the name of the string given the ID returns empty string if nothing found

Todo:
should we throw here?

§ registerStringID()

util::StringID osvr::common::RegisteredStringMap::registerStringID ( std::string const &  str)

register new ID with given string and returns StringID.

If string already exists, then it returns existing StringID


The documentation for this class was generated from the following files: