Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

SetOfNo(Type) Class Reference

set of objects, arbitrary set size. More...

#include <SetOfNo_Type.h>

Inheritance diagram for SetOfNo(Type)::

HandleId List of all members.

Public Methods

 SetOfNo(Type) (int max_size)
 SetOfNo(Type) ()
 ~SetOfNo(Type) ()
bool convert2vector (VecSimple(Type) &v)
bool convert2vector (Ptv(Type) &v)
int getNoMembers () const
bool indexOk (int i) const
bool ok () const
Type& getMember (int i)
const Type& getMember (int i) const
Type& operator() (int i)
const Type& operator() (int i) const
bool operator== (Type value)
bool operator!= (Type value)
bool within (Type value, Type tolerance)
bool within (Type value, Type tolerance, int &i)
bool withinUnmarked (Type value, Type tolerance)
bool withinUnmarked (Type value, Type tolerance, int &i)
void add (Type value)
void mark (int i)
bool isMarked (int i) const
void removeMarks ()
void removeLast ()
void reset ()
void remove ()
bool empty () const
void print (Os os, int nmembers_between_each_newline=6, bool unmarked_members_only=false) const
void scan (Is is, char startmark='\0', char sepmark='', char endmark=';')

Friends

Osoperator<< (Os &os, const SetOfNo(Type) set)
Isoperator>> (Is &is, SetOfNo(Type) &set)

Detailed Description

set of objects, arbitrary set size.

NAME: SetOfNo(Type) - set of objects, arbitrary set size

DESCRIPTION:

The class enables the programmer to operate with a set of objects of arbitrary size. For example, the objects can be read in a very flexible format from file. Search functions can be called to determine if a given number (entry) is present in the set. The main applications are e.g. in connection with specification of points of time or points in space at which the user wants results from a simulation. The various functions in the class will require that "Type" is a class that implements "operator<<", "operator>>", "operator=", "operator+". If this is inconvenient, a simpler class "SetSimplest(Type)" is also available.


Constructor & Destructor Documentation

SetOfNo(Type)::SetOfNo_Type ( int max_size )
 

One constructor takes no arguments, while the other has an argument reflecting the assumed size of the set. For the constructor without arguments the assumed size is 100. If the number of entries exceeds the assumed size, the "SetOfNo" class will automatically extends its internal memory in chunks which have the size of the initially assumed size.

Initialization of the set members is performed through the "scan" function which reads a file in a certain format. The function "add" can also be used for adding new members to the set.

SetOfNo(Type)::SetOfNo_Type ( )
 

See documentation of one of the overloaded constructor.

SetOfNo(Type)::~SetOfNo(Type) ( ) [inline]
 


Member Function Documentation

void SetOfNo(Type)::add ( Type value )
 

bool SetOfNo(Type)::convert2vector ( Ptv(Type) & v )
 

bool SetOfNo(Type)::convert2vector ( VecSimple(Type) & v )
 

bool SetOfNo(Type)::empty ( ) const [inline]
 

const Type & SetOfNo(Type)::getMember ( int i ) const
 

Type & SetOfNo(Type)::getMember ( int i )
 

int SetOfNo(Type)::getNoMembers ( ) const [inline]
 

bool SetOfNo(Type)::indexOk ( int i ) const
 

bool SetOfNo(Type)::isMarked ( int i ) const
 

void SetOfNo(Type)::mark ( int i )
 

bool SetOfNo(Type)::ok ( ) const [inline]
 

bool SetOfNo(Type)::operator!= ( Type value ) [inline]
 

const Type & SetOfNo(Type)::operator() ( int i ) const
 

Type & SetOfNo(Type)::operator() ( int i )
 

bool SetOfNo(Type)::operator== ( Type value )
 

void SetOfNo(Type)::print ( Os os,
int nmembers_between_each_newline = 6,
bool unmarked_members_only = false ) const
 

void SetOfNo(Type)::remove ( ) [inline]
 

void SetOfNo(Type)::removeLast ( )
 

void SetOfNo(Type)::removeMarks ( )
 

void SetOfNo(Type)::reset ( )
 

void SetOfNo(Type)::scan ( Is is,
char startmark = '\0',
char sepmark = ' ',
char endmark = ';' )
 

bool SetOfNo(Type)::within ( Type value,
Type tolerance,
int & i )
 

bool SetOfNo(Type)::within ( Type value,
Type tolerance )
 

bool SetOfNo(Type)::withinUnmarked ( Type value,
Type tolerance,
int & i )
 

bool SetOfNo(Type)::withinUnmarked ( Type value,
Type tolerance )
 


Friends And Related Function Documentation

Os & operator<< ( Os & os,
const SetOfNo(Type) set ) [friend]
 

Is & operator>> ( Is & is,
SetOfNo(Type) & set ) [friend]
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.