Class Hierarchy   Compound List   File List   Header Files   Compound Members   File Members  

LString Class Reference

is a shared value string class so that comparisons for equality only require a pointer comparison. More...

#include <common/lstring.h>

List of all members.


Public Members

LString (void)
build an empty LString.

LString (const char *pStr)
build an Lstring for a char *
Warning:
{this is a slow operation, requiring a hash table lookup.
More...


LString (const LString& lstring)
copy constructor (fast).

LString (const String &x)
Create an LString from a String. More...

unsigned size () const
Return length of LString.

unsigned length () const
Return length of LString.

const char* c_str () const
Return as const char *.

operator const char * () const
Return as a cast. More...

String operator+ (const LString& lstring2) const
bool operator== (const LString &lstring) const
bool operator!= (const LString &lstring) const
LString& operator= (const LString &lstring)
bool operator< (const LString &lstring) const
int get_ordinal () const
get ordinal associate with an LString. More...


Static Public Members

bool exists (const char *str)
Does an LString exist with the given value
Warning:
{This merely looks in the table for an entry.
More...



Detailed Description

is a shared value string class so that comparisons for equality only require a pointer comparison.

In addition, each unique value has an unique ordinal associated with it which makes it easy to build arrays using an LString index. \see SparseVector

Warning:
{ordinals may change from execution to execution - do not use them for persistence.}

Member Function Documentation

LString::LString (void)

build an empty LString.

LString::LString (const char * pStr)

build an Lstring for a char *

Warning:
{this is a slow operation, requiring a hash table lookup.

For LString constants, create them during program initialization using static LStrings and try to share commonly used constants}

LString::LString (const LString & lstring)

copy constructor (fast).

LString::LString (const String & x)

Create an LString from a String.

Also slow - see above comments

unsigned LString::size () const

Return length of LString.

unsigned LString::length () const

Return length of LString.

const char * LString::c_str () const

Return as const char *.

LString::operator const char * () const

Return as a cast.

Will happen implicitly

String LString::operator+ (const LString & lstring2) const

bool LString::operator== (const LString & lstring) const

bool LString::operator!= (const LString & lstring) const

LString & LString::operator= (const LString & lstring)

bool LString::operator< (const LString & lstring) const

int LString::get_ordinal () const

get ordinal associate with an LString.

Each unique LString has a unique ordinal. This is useful for indexing into an array (for operators, for example, which are LStrings in SUIF)

bool LString::exists (const char * str) [static]

Does an LString exist with the given value

Warning:
{This merely looks in the table for an entry.

Extries are not removed when an LString is destructed, so there may be no actual LString with the given value}


The documentation for this class was generated from the following files:
Generated at Wed Apr 25 17:34:59 2001 for NCI SUIF by doxygen  written by Dimitri van Heesch, © 1997-1999