MechSys  1.0
Computing library for simulations in continuum and discrete mechanics
Public Member Functions | Public Attributes
SDPair Class Reference

#include <maps.h>

List of all members.

Public Member Functions

 SDPair ()
 Default constructor.
 SDPair (SDPair const &R)
 Copy constructor.
void Set (const char *Str,...)
 Set given keys and vals: Set("ux uy", 1.0,2.0). NOTE: vals must be double.
void SetZero (Array< String > const &keys)
 Create pair with all keys set to zero.
double & operator() (char const *Key)
double const & operator() (char const *Key) const
double & operator() (String const &Key)
double const & operator() (String const &Key) const
void operator= (SDPair const &R)
 Assignment operator.
void operator+= (SDPair const &R)
 Used to merge keys, but not sum them up.
void Del (const char *Key)
 Delete key (and value) from pair.
size_t ReSet (const char *Key, double Val)
 Re-set value (creates if it doesn't exist). Return position in Keys of changed/set value.
size_t AddVal (const char *Key, double Val)
 Add value to existent one (creates if it doesn't exist). Return position in Keys of changed/set value.
void SetValues (double Val)
 Set all values equal to Val.
double ValOrZero (char const *Key) const
 Returns value for Key if Key exists, otherwise returns zero.
double ValOrZero (String const &Key) const
bool HasKey (char const *Key) const
bool HasKey (String const &Key) const
long IdxKey (String const &Key) const
 Returns the index of key if found, otherwise returns -1.
void Val2Key (double Val, String &Key, double Tol=1.0e-15) const
void clear ()

Public Attributes

Array< StringKeys

Detailed Description

String-Double Pair.


Constructor & Destructor Documentation

SDPair::SDPair ( ) [inline]

Default constructor.

SDPair::SDPair ( SDPair const &  R) [inline]

Copy constructor.


Member Function Documentation

size_t SDPair::AddVal ( const char *  Key,
double  Val 
) [inline]

Add value to existent one (creates if it doesn't exist). Return position in Keys of changed/set value.

void SDPair::clear ( ) [inline]
void SDPair::Del ( const char *  Key) [inline]

Delete key (and value) from pair.

bool SDPair::HasKey ( char const *  Key) const [inline]
bool SDPair::HasKey ( String const &  Key) const [inline]
long SDPair::IdxKey ( String const &  Key) const [inline]

Returns the index of key if found, otherwise returns -1.

double & SDPair::operator() ( char const *  Key) [inline]
double const & SDPair::operator() ( char const *  Key) const [inline]
double& SDPair::operator() ( String const &  Key) [inline]
double const& SDPair::operator() ( String const &  Key) const [inline]
void SDPair::operator+= ( SDPair const &  R) [inline]

Used to merge keys, but not sum them up.

void SDPair::operator= ( SDPair const &  R) [inline]

Assignment operator.

size_t SDPair::ReSet ( const char *  Key,
double  Val 
) [inline]

Re-set value (creates if it doesn't exist). Return position in Keys of changed/set value.

void SDPair::Set ( const char *  Str,
  ... 
) [inline]

Set given keys and vals: Set("ux uy", 1.0,2.0). NOTE: vals must be double.

void SDPair::SetValues ( double  Val) [inline]

Set all values equal to Val.

void SDPair::SetZero ( Array< String > const &  keys) [inline]

Create pair with all keys set to zero.

void SDPair::Val2Key ( double  Val,
String Key,
double  Tol = 1.0e-15 
) const [inline]
double SDPair::ValOrZero ( char const *  Key) const [inline]

Returns value for Key if Key exists, otherwise returns zero.

double SDPair::ValOrZero ( String const &  Key) const [inline]

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines