Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cAtomRef Class Reference

#include <cAtom.h>

Public Member Functions

 cAtomRef (const THIS_t &ref) noexcept
 
 cAtomRef (const STR_t &sName) noexcept
 
 cAtomRef (const ATOMCHAR_t *pszName="") noexcept
 
 ~cAtomRef ()
 
size_t GetHeapStats (OUT ITERATE_t &iAllocCount) const
 
ATOMCODE_t get_HashCode () const noexcept
 
const STR_tget_StrA () const noexcept
 
const ATOMCHAR_tget_CPtr () const noexcept
 < as a C string More...
 
 operator const ATOMCHAR_t * () const noexcept
 < as a C string More...
 
bool isValidCheck () const noexcept
 
bool IsEmpty () const
 
StrLen_t GetLength () const
 
bool operator== (const cAtomRef &atom) const noexcept
 
COMPARE_t CompareNoCase (const ATOMCHAR_t *pStr) const
 
bool operator== (const ATOMCHAR_t *pStr) const
 
const THIS_toperator= (const THIS_t &atom)
 
const THIS_toperator= (const ATOMCHAR_t *pStr)
 
const THIS_toperator= (const STR_t &sStr)
 
void EmptyAtom ()
 
void SetAtomStatic ()
 

Static Public Member Functions

static void __stdcall CreateStaticAtoms (const ATOMCHAR_t **ppAtoms)
 
static cAtomRef __stdcall FindAtomStr (const ATOMCHAR_t *pszText)
 
static cAtomRef __stdcall FindAtomHashCode (ATOMCODE_t idAtomCode)
 
static HRESULT __stdcall CheckSymbolicStr (const ATOMCHAR_t *pszTag, bool bAllowDots=false)
 
static StrLen_t __stdcall GetSymbolicStr (OUT ATOMCHAR_t *pszTag, const ATOMCHAR_t *pszExp, bool bAllowDots=false)
 

Friends

class cAtomManager
 
class cAtomTests
 

Detailed Description

A single string name shared by all. Similar to the _WIN32 ATOM GlobalAddAtom(). but not system shared of course. case independent. e.g. THIS==this=>same atom.

Constructor & Destructor Documentation

◆ cAtomRef() [1/3]

Gray::cAtomRef::cAtomRef ( const THIS_t ref)
inlinenoexcept

◆ cAtomRef() [2/3]

Gray::cAtomRef::cAtomRef ( const STR_t sName)
inlinenoexcept

◆ cAtomRef() [3/3]

Gray::cAtomRef::cAtomRef ( const ATOMCHAR_t pszName = "")
inlinenoexcept

◆ ~cAtomRef()

Gray::cAtomRef::~cAtomRef ( )
inline

Member Function Documentation

◆ CheckSymbolicStr()

HRESULT GRAYCALL Gray::cAtomRef::CheckSymbolicStr ( const ATOMCHAR_t pszTag,
bool  bAllowDots = false 
)
static

Is this a simple 'c' style identifier/symbolic string? starts with a char and can have numbers.

Note
JSON allows '.' as part of normal names ??
  • pszTag = the identifier (valid char set).
Returns
> 0 = length else < 0 = HRESULT error.

◆ CompareNoCase()

COMPARE_t Gray::cAtomRef::CompareNoCase ( const ATOMCHAR_t pStr) const
inline

◆ CreateStaticAtoms()

void GRAYCALL Gray::cAtomRef::CreateStaticAtoms ( const ATOMCHAR_t **  ppAtoms)
static

For use with CATOM_STATIC()

  • ppAtoms = A nullptr terminated array of static text to make into atoms.

◆ EmptyAtom()

void Gray::cAtomRef::EmptyAtom ( )
inline

◆ FindAtomHashCode()

cAtomRef GRAYCALL Gray::cAtomRef::FindAtomHashCode ( ATOMCODE_t  idAtomCode)
static

Get this hash id if a valid atom hash

Returns
m_aEmpty atom if not found.

◆ FindAtomStr()

cAtomRef GRAYCALL Gray::cAtomRef::FindAtomStr ( const ATOMCHAR_t pszText)
static

Find the atom in the atom table if it exists.

Note
DO NOT CREATE IT!
Returns
m_aEmpty atom if not found.

◆ get_CPtr()

const ATOMCHAR_t* Gray::cAtomRef::get_CPtr ( ) const
inlinenoexcept

< as a C string

◆ get_HashCode()

ATOMCODE_t Gray::cAtomRef::get_HashCode ( ) const
inlinenoexcept

particular hash value is not important. Value just needs to be unique and consistent on a single machine.

◆ get_StrA()

const STR_t& Gray::cAtomRef::get_StrA ( ) const
inlinenoexcept

◆ GetHeapStats()

size_t Gray::cAtomRef::GetHeapStats ( OUT ITERATE_t iAllocCount) const

Every user of the atom dears 1/n of the usage of the memory return SUPER_t::GetHeapStats(iAllocCount);

◆ GetLength()

StrLen_t Gray::cAtomRef::GetLength ( ) const
inline

◆ GetSymbolicStr()

StrLen_t GRAYCALL Gray::cAtomRef::GetSymbolicStr ( OUT ATOMCHAR_t pszTag,
const ATOMCHAR_t pszExp,
bool  bAllowDots = false 
)
static

Parse the string and make a legal symbolic name using only valid symbols characters.

  • pszTagRet = Copy the identifier (valid char set) out to this buffer. ASSUME StrT::k_LEN_MAX_KEY
  • pszExp = point to source string
  • bAllowDots = allow dots and stuff to follow them. JSON
    Returns
    <0 = error. Length of the tag + args. 0 = nothing here worth doing anything with.

◆ IsEmpty()

bool Gray::cAtomRef::IsEmpty ( ) const
inline

◆ isValidCheck()

bool Gray::cAtomRef::isValidCheck ( ) const
inlinenoexcept

◆ operator const ATOMCHAR_t *()

Gray::cAtomRef::operator const ATOMCHAR_t * ( ) const
inlinenoexcept

< as a C string

◆ operator=() [1/3]

const THIS_t& Gray::cAtomRef::operator= ( const ATOMCHAR_t pStr)
inline

◆ operator=() [2/3]

const THIS_t& Gray::cAtomRef::operator= ( const STR_t sStr)
inline

◆ operator=() [3/3]

const THIS_t& Gray::cAtomRef::operator= ( const THIS_t atom)
inline

◆ operator==() [1/2]

bool Gray::cAtomRef::operator== ( const ATOMCHAR_t pStr) const
inline

◆ operator==() [2/2]

bool Gray::cAtomRef::operator== ( const cAtomRef atom) const
inlinenoexcept

◆ SetAtomStatic()

void Gray::cAtomRef::SetAtomStatic ( )

Make this atom permanent. never removed from the atom table.

Friends And Related Function Documentation

◆ cAtomManager

friend class cAtomManager
friend

◆ cAtomTests

friend class cAtomTests
friend

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