ISIS Core Library 0.7.2 (api 3.0.0)
Public Member Functions

isis::util::Selection Class Reference

Here, a Selection is one of our types (see types.hpp) and meant as an enumeration of "things" described by strings, e.g. More...

#include <selection.hpp>

Public Member Functions

std::list< util::istringgetEntries () const
 operator int () const
 Implicit cast to int.
 operator std::string () const
 Implicit cast to string.
 operator util::istring () const
 Implicit cast to istring.
bool operator== (const Selection &ref) const
 Common comparison.
bool operator== (const char ref[]) const
 String comparison.
bool operator== (const int ref) const
 Number comparison.
 Selection ()
 Fallback contructor to enable creation of empty selections.
template<typename T >
 Selection (const std::map< T, std::string > &map)
 Default constructor.
 Selection (const char *entries, const char *init_val="")
 Default constructor.
bool set (const char *entry)
 Set the selection to the given type.
bool set (unsigned short entry)

Detailed Description

Here, a Selection is one of our types (see types.hpp) and meant as an enumeration of "things" described by strings, e.g.

properties for easy acces of several properties from a PopertyMap. It's using isis::util::istring, therefore the options are CASE INSENSITIVE.

Definition at line 39 of file selection.hpp.


Constructor & Destructor Documentation

isis::util::Selection::Selection ( const char *  entries,
const char *  init_val = "" 
)

Default constructor.

Creates a selection with the given options.

Parameters:
entriescomma separated list of the options as a string
init_valthe string which should be selected after initialisation (must be one from entries)
Warning:
this is really only comma separated, so write "first,second,and,so,on" and not "first, second, and, so, on"

Definition at line 18 of file selection.cpp.

template<typename T >
isis::util::Selection::Selection ( const std::map< T, std::string > &  map)

Default constructor.

Creates a selection from a number-option map.

Parameters:
mapa map which maps specific numbers (must not be 0) to options to be used

Definition at line 104 of file selection.hpp.

isis::util::Selection::Selection ( )

Fallback contructor to enable creation of empty selections.

Definition at line 32 of file selection.cpp.


Member Function Documentation

std::list< util::istring > isis::util::Selection::getEntries ( ) const
Returns:
a list of all options

Definition at line 86 of file selection.cpp.

isis::util::Selection::operator int ( ) const

Implicit cast to int.

The numbers correspont to the order the options where given at the creation of the selection (first option -> 1, second option -> 2 ...)

Returns:
number corresponding the currently set option or "0" if none is set

Definition at line 34 of file selection.cpp.

isis::util::Selection::operator std::string ( ) const

Implicit cast to string.

Returns:
the currently set option or "<<NOT_SET>>" if none is set

Definition at line 43 of file selection.cpp.

isis::util::Selection::operator util::istring ( ) const

Implicit cast to istring.

Returns:
the currently set option or "<<NOT_SET>>" if none is set

Definition at line 35 of file selection.cpp.

bool isis::util::Selection::operator== ( const char  ref[]) const

String comparison.

Returns:
true if the currently set option is non-case-sensitive equal to the given string. False otherwise.

Definition at line 76 of file selection.cpp.

bool isis::util::Selection::operator== ( const int  ref) const

Number comparison.

Returns:
true if the number corresponding the currently set option is equal to the given number. False otherwise.

Definition at line 80 of file selection.cpp.

bool isis::util::Selection::operator== ( const Selection ref) const

Common comparison.

Returns:
true if both selection have the same options and are currently set to the the option. False otherwise.

Definition at line 72 of file selection.cpp.

bool isis::util::Selection::set ( const char *  entry)

Set the selection to the given type.

If the given option does not exist, a runtime error will be send and the selection won't be set.

Parameters:
entrythe option the selection should be set to.
Returns:
true if the option was set, false otherwise.

Definition at line 59 of file selection.cpp.

bool isis::util::Selection::set ( unsigned short  entry)

Definition at line 49 of file selection.cpp.


The documentation for this class was generated from the following files: