Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Advanced Tools Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWSymbol

Module:  Advanced Tools   Package:  Types


RWSymbol RWHandleBase

Local Index

Members

Header File

#include "rw/types/RWSymbol.h";

Description

Class RWSymbol is the only API class in the Types package.

It encapsulates a string name in a reference-counted handle-body pattern. Therefore, several RWSymbols can reference one string name, making storage space smaller, name memory management easier, and name comparisons faster.

The strings are stored internally as wide characters (wchar_t). Members are provided to construct symbols from ASCII or wide characters.

RWSymbol objects can be streamed across the network, to files, and to standard input and output. The genSymbol() static member allows you to create unique symbols from a name.

RWSymbol inherits a highly efficient operator==() from RWHandleBase. RWHandleBase::operator==() returns true or false based on whether the two RWHandleBases point to the same body instance.

Static Member Functions

static RWSymbol       
genSymbol(const RWCString& prefix);
static RWSymbol       
genSymbol(const RWWString& prefix = L"G");
static unsigned       
hash(const RWSymbol& key);

Public Constructors

RWSymbol();
RWSymbol(const char* name);
RWSymbol(const wchar_t* name);
RWSymbol(const RWSymbol&);

Public Destructors

~RWSymbol();

Public Operators

bool             
operator<(const RWSymbol& rhs) const;
friend RW_TYPES_DECLSPEC RWvistream&    
operator>>(RWvistream& vstrm, RWSymbol& sym);
friend RW_TYPES_DECLSPEC RWvostream&    
operator<<(RWvostream& vstrm, const RWSymbol& sym);

Public Member Functions

bool             
isBound() const;
RWCString             
asAsciiString() const;
RWWString             
asWCharString() const;
friend RW_TYPES_DECLSPEC 
RW_SL_IO_STD(istream)& operator>>(RW_SL_IO_STD(istream)& strm,
RWSymbol& sym);
friend RW_TYPES_DECLSPEC 
RW_SL_IO_STD(ostream)& operator<<(RW_SL_IO_STD(ostream)& strm,
const RWSymbol& sym);
friend 
RW_SL_IO_STD(wcistream)& operator>>
(RW_SL_IO_STD(wcistream)& strm, RWSymbol& sym);
friend 
RW_SL_IO_STD(wcostream)& operator<<
(RW_SL_IO_STD(wcostream)& strm, const RWSymbol& sym);
int                   
collate(const RWSymbol& rhs) const;
unsigned              
hash() const;


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.