38 Name(
const std::string& name);
47 operator std::string()
const;
58 const char *c_str()
const;
80 char operator[] (
size_t index)
const;
84 agx::Name& operator= (
const std::string& other);
90 bool operator== (
const agx::Name& other)
const;
91 bool operator== (
const std::string& other)
const;
93 bool operator== (
const char *other)
const;
95 bool operator!= (
const agx::Name& other)
const;
96 bool operator!= (
const std::string& other)
const;
98 bool operator!= (
const char *other)
const;
110 void swap(
Name& rhs);
120 void init(
const char *name);
121 static char *allocateSharedString(
const char *
string);
123 static const char *getSharedString(
const char *str);
124 static void destroySharedString(
const char *str);
125 static Header& getHeader(
const char *buf);
128 const Header& header()
const;
134 static const char *s_emptyString;
167 s_emptyString = Name::getSharedString(
"");
168 m_buf = s_emptyString;
172 m_buf = s_emptyString;
211 AGX_FORCE_INLINE Name::Header& Name::getHeader(
const char *buf) {
agxAssert(buf);
return *(Header *)(buf -
sizeof(Header)); }
214 AGX_FORCE_INLINE Name::Header& Name::header() {
return Name::getHeader(m_buf); }
215 AGX_FORCE_INLINE const Name::Header& Name::header()
const {
return Name::getHeader(m_buf); }
220 UInt32 refCount = (
UInt32)this->header().refCount.dec()-1;
224 Name::destroySharedString(m_buf);
244 (*this) = other.
c_str();
250 (*this) = other.c_str();
263 const_cast<Name&
>(other).incRef();
273 return m_buf == other.m_buf;
279 return m_buf == other;
285 return m_buf ==
static_cast<const std::string&
>(other);
291 return strcmp(m_buf, other) == 0;
AGXCORE_EXPORT agx::String operator+(const std::string &str, const agx::Name &name)
Representation of a name string.
agx::Name & operator=(const agx::Name &other)
Copy operators.
char operator[](size_t index) const
agx::UInt32 length() const
Name(const std::string &name)
bool operator==(const agx::Name &other) const
Comparison operators.
const char * c_str() const
bool operator!=(const agx::Name &other) const
Name(const agx::String &name)
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
UInt32 hash(const T &key)
bool operator!=(T val, InvalidIndexStruct)
AgXString< std::string > String
std::ostream & operator<<(std::ostream &os, const agx::AddedMassInteraction::Matrix6x6 &m)
bool operator==(T val, InvalidIndexStruct)
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API.
void swap(agx::Name &lhs, agx::Name &rhs)