Cortex  10.0.0-a4
Public Member Functions | Static Public Member Functions | List of all members
IECore::InternedString Class Reference

#include <InternedString.h>

Public Member Functions

 InternedString (const std::string &value)
 
 InternedString (const InternedString &other)
 
 InternedString (const char *value)
 
 InternedString (const char *value, size_t length)
 
 InternedString (int64_t number)
 
bool operator!= (const InternedString &other) const
 
bool operator== (const InternedString &other) const
 
bool operator< (const InternedString &other) const
 
 operator const std::string & () const
 
const std::string & value () const
 
const std::string & string () const
 
const char * c_str () const
 

Static Public Member Functions

static size_t numUniqueStrings ()
 

Detailed Description

The InternedString class provides a means of efficiently storing multiple different objects with the same string value. It does this by keeping a static table with the actual values in it, with the object instances just referencing the values in the table.

Member Function Documentation

bool IECore::InternedString::operator< ( const InternedString other) const
inline

Note that this compares the addresses of the internal unique strings, rather than performing an actual string comparison.

Todo:
: Several use cases would benefit from sorting by string value here. Investigate ways of making these comparisons by string value, while maintaining constant-time complexity.

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