Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

SSD::ustring Class Reference

Class which stores each string only once and enables faster comparision. More...

#include <ustring.h>

List of all members.

Public Member Functions

 ustring (const char *s)
 unify a char string
 ustring (const xmlChar *s)
 unify an xmlChar string
bool operator== (const ustring other) const
 trivial compare operators using pointer value
bool operator<= (const ustring other) const
 trivial compare operators using pointer value
bool operator< (const ustring other) const
 trivial compare operators using pointer value
bool operator>= (const ustring other) const
 trivial compare operators using pointer value
bool operator> (const ustring other) const
 trivial compare operators using pointer value
bool operator!= (const ustring other) const
 trivial compare operators using pointer value
bool empty () const
 test if this actually represents a nonempty string
size_t hashfun () const
 hash function is just using the pointer value

Private Attributes

const char * cstr
 string this represents

Static Private Attributes

static hash_map< const char *,
const char *, hash< char * >,
eq_str
store
 global store for "unified" strings

Friends

std::ostream & operator<< (std::ostream &out, const ustring &str)
 append ustring to output stream for easier writing


Detailed Description

Class which stores each string only once and enables faster comparision.

by storing only one copy of each string, we can reduce string comparisions to pointer comparisions, which speeds up live a lot...

Definition at line 37 of file ustring.h.


Constructor & Destructor Documentation

SSD::ustring::ustring const char *  s  ) 
 

unify a char string

Parameters:
s char string to be unified

Definition at line 21 of file ustring.cc.

References cstr, and store.

SSD::ustring::ustring const xmlChar *  s  ) 
 

unify an xmlChar string

Parameters:
s xmlChar string to be unified

Definition at line 51 of file ustring.cc.

References cstr, and store.


Member Function Documentation

bool SSD::ustring::empty  )  const [inline]
 

test if this actually represents a nonempty string

Definition at line 82 of file ustring.h.

References cstr.

Referenced by SSD::Doc::appendNodeAttribute(), SSD::Doc::appendNodeElement(), and SSD::Doc::appendNodeText().

size_t SSD::ustring::hashfun  )  const [inline]
 

hash function is just using the pointer value

Definition at line 84 of file ustring.h.

References cstr.

Referenced by SSD::RelEqClass::hashfun(), SSD::NodeEqClass::hashfun(), and SSD::hash_ustring::operator()().

bool SSD::ustring::operator!= const ustring  other  )  const [inline]
 

trivial compare operators using pointer value

Parameters:
other ustring to be compared with

Definition at line 78 of file ustring.h.

References cstr.

bool SSD::ustring::operator< const ustring  other  )  const [inline]
 

trivial compare operators using pointer value

Parameters:
other ustring to be compared with

Definition at line 63 of file ustring.h.

References cstr.

bool SSD::ustring::operator<= const ustring  other  )  const [inline]
 

trivial compare operators using pointer value

Parameters:
other ustring to be compared with

Definition at line 58 of file ustring.h.

References cstr.

bool SSD::ustring::operator== const ustring  other  )  const [inline]
 

trivial compare operators using pointer value

Parameters:
other ustring to be compared with

Definition at line 53 of file ustring.h.

References cstr.

bool SSD::ustring::operator> const ustring  other  )  const [inline]
 

trivial compare operators using pointer value

Parameters:
other ustring to be compared with

Definition at line 73 of file ustring.h.

References cstr.

bool SSD::ustring::operator>= const ustring  other  )  const [inline]
 

trivial compare operators using pointer value

Parameters:
other ustring to be compared with

Definition at line 68 of file ustring.h.

References cstr.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  out,
const ustring str
[friend]
 

append ustring to output stream for easier writing

Parameters:
out output stream to be appended to
str unified string to be appended

Definition at line 81 of file ustring.cc.


Member Data Documentation

const char* SSD::ustring::cstr [private]
 

string this represents

Definition at line 39 of file ustring.h.

Referenced by empty(), hashfun(), operator!=(), operator<(), SSD::operator<<(), operator<=(), operator==(), operator>(), operator>=(), and ustring().

hash_map< const char *, const char *, hash< char * >, eq_str > SSD::ustring::store [static, private]
 

global store for "unified" strings

Definition at line 86 of file ustring.cc.

Referenced by ustring().


The documentation for this class was generated from the following files:
Generated on Thu Aug 4 17:59:30 2005 for SSDDiff by  doxygen 1.4.3-20050530