ODIN
Public Member Functions | List of all members

#include <ldrtypes.h>

Inheritance diagram for LDRenum:
Inheritance graph
[legend]

Public Member Functions

 LDRenum ()
 
 LDRenum (const STD_string &first_entry, const STD_string &name="")
 
 LDRenum (const LDRenum &je)
 
LDRenumoperator= (const char *item)
 
LDRenumoperator= (const STD_string &item)
 
LDRenumoperator= (int item)
 
LDRenumoperator= (const LDRenum &je)
 
LDRenumadd_item (const STD_string &item, int index=-1)
 
LDRenumset_actual (const STD_string &item)
 
LDRenumset_actual (int index)
 
LDRenumclear ()
 
 operator int () const
 
 operator STD_string () const
 
bool operator== (const STD_string &s) const
 
bool operator== (const char *s) const
 
bool operator== (int i) const
 
bool operator!= (const STD_string &s) const
 
bool operator!= (const char *s) const
 
bool operator!= (int i) const
 
unsigned int n_items () const
 
const STD_string & get_item (unsigned int index) const
 
unsigned int get_item_index () const
 
LDRenumset_item_index (unsigned int index)
 
bool parsevalstring (const STD_string &parstring, const LDRserBase *ser=0)
 
STD_string printvalstring (const LDRserBase *ser=0) const
 
svector get_alternatives () const
 
STD_string get_typeInfo (bool parx_equivtype=false) const
 
LDRbasecreate_copy () const
 
- Public Member Functions inherited from LDRbase
virtual STD_string print (const LDRserBase &serializer=LDRserJDX()) const
 
virtual STD_ostream & print2stream (STD_ostream &os, const LDRserBase &serializer) const
 
virtual int write (const STD_string &filename, const LDRserBase &serializer=LDRserJDX()) const
 
virtual bool parse (STD_string &parstring, const LDRserBase &serializer=LDRserJDX())
 
virtual int load (const STD_string &filename, const LDRserBase &serializer=LDRserJDX())
 
virtual double get_minval () const
 
virtual double get_maxval () const
 
bool has_minmax () const
 
const STD_string & get_description () const
 
LDRbaseset_description (const STD_string &descr)
 
const STD_string & get_unit () const
 
LDRbaseset_unit (const STD_string &un)
 
virtual parameterMode get_parmode () const
 
virtual LDRbaseset_parmode (parameterMode parameter_mode)
 
virtual fileMode get_filemode () const
 
virtual LDRbaseset_filemode (fileMode file_mode)
 
virtual GuiProps get_gui_props () const
 
virtual LDRbaseset_gui_props (const GuiProps &)
 
virtual STD_string get_parx_code (parxCodeType type) const
 
JcampDxProps get_jdx_props () const
 
LDRbaseset_jdx_props (const JcampDxProps &jp)
 
- Public Member Functions inherited from Labeled
 Labeled (const STD_string &label="unnamed")
 
Labeledset_label (const STD_string &label)
 
const STD_string & get_label () const
 
Labeledoperator= (const Labeled &l)
 

Detailed Description

Labeled Data Record (LDR) class to represent enumerations

Definition at line 168 of file ldrtypes.h.

Constructor & Destructor Documentation

◆ LDRenum() [1/3]

LDRenum::LDRenum ( )
inline

Default constructor

Definition at line 175 of file ldrtypes.h.

◆ LDRenum() [2/3]

LDRenum::LDRenum ( const STD_string &  first_entry,
const STD_string &  name = "" 
)

Constructor with the following arguments:

  • first_entry: Initial value for the first entry of the enumeration
  • name: The label of the parameter

◆ LDRenum() [3/3]

LDRenum::LDRenum ( const LDRenum je)
inline

Copy constructor

Definition at line 187 of file ldrtypes.h.

Member Function Documentation

◆ add_item()

LDRenum& LDRenum::add_item ( const STD_string &  item,
int  index = -1 
)

Appends an item to the the list of items in the enumeration. If index is non-negative, the item will be inserted at the position indicated by index.

◆ clear()

LDRenum& LDRenum::clear ( )

Clears the list of items in the enumeration

◆ create_copy()

LDRbase* LDRenum::create_copy ( ) const
inlinevirtual

Returns a deep copy of the parameter

Implements LDRbase.

Definition at line 299 of file ldrtypes.h.

◆ get_alternatives()

svector LDRenum::get_alternatives ( ) const
virtual

Returns possible alternative values of the parameter, i.e. the item strings of an enum

Reimplemented from LDRbase.

◆ get_item()

const STD_string& LDRenum::get_item ( unsigned int  index) const

Returns the item at the position 'index' in the label-index map

◆ get_item_index()

unsigned int LDRenum::get_item_index ( ) const

Returns the current position in the label-index map

◆ get_typeInfo()

STD_string LDRenum::get_typeInfo ( bool  parx_equivtype = false) const
inlinevirtual

Returns a string describing the type of the parameter. If 'parx_equivtype' is 'true', returns the equivalent PARX parameter type

Implements LDRbase.

Definition at line 298 of file ldrtypes.h.

◆ n_items()

unsigned int LDRenum::n_items ( ) const
inline

Returns the number of items in the enumeration

Definition at line 276 of file ldrtypes.h.

◆ operator int()

LDRenum::operator int ( ) const

type conversion operator of the current value of the enumeration

◆ operator STD_string()

LDRenum::operator STD_string ( ) const

type conversion operator of the current value of the enumeration

◆ operator!=() [1/3]

bool LDRenum::operator!= ( const char *  s) const
inline

Compares the current value with s for inequality

Definition at line 265 of file ldrtypes.h.

◆ operator!=() [2/3]

bool LDRenum::operator!= ( const STD_string &  s) const
inline

Compares the current value with s for inequality

Definition at line 260 of file ldrtypes.h.

◆ operator!=() [3/3]

bool LDRenum::operator!= ( int  i) const
inline

Compares the current index with i for inequality

Definition at line 270 of file ldrtypes.h.

◆ operator=() [1/4]

LDRenum& LDRenum::operator= ( const char *  item)
inline

Sets the current value of the enumeration to the given item

Definition at line 193 of file ldrtypes.h.

◆ operator=() [2/4]

LDRenum& LDRenum::operator= ( const LDRenum je)

Assignment operator

◆ operator=() [3/4]

LDRenum& LDRenum::operator= ( const STD_string &  item)
inline

Sets the current value of the enumeration to the given item

Definition at line 198 of file ldrtypes.h.

◆ operator=() [4/4]

LDRenum& LDRenum::operator= ( int  item)
inline

Sets the current value of the enumeration to the given item

Definition at line 203 of file ldrtypes.h.

◆ operator==() [1/3]

bool LDRenum::operator== ( const char *  s) const
inline

Compares the current value with s for equality

Definition at line 250 of file ldrtypes.h.

◆ operator==() [2/3]

bool LDRenum::operator== ( const STD_string &  s) const
inline

Compares the current value with s for equality

Definition at line 245 of file ldrtypes.h.

◆ operator==() [3/3]

bool LDRenum::operator== ( int  i) const
inline

Compares the current index with i for equality

Definition at line 255 of file ldrtypes.h.

◆ parsevalstring()

bool LDRenum::parsevalstring ( const STD_string &  ,
const LDRserBase ser = 0 
)
virtual

Parses and assigns the value in the given string, optionally using format 'ser'

Implements LDRbase.

◆ printvalstring()

STD_string LDRenum::printvalstring ( const LDRserBase ser = 0) const
virtual

Returns the value of the parameter as a string, optionally using format 'ser'

Implements LDRbase.

◆ set_actual() [1/2]

LDRenum& LDRenum::set_actual ( const STD_string &  item)

Sets the current value of the enumeration to the given item

◆ set_actual() [2/2]

LDRenum& LDRenum::set_actual ( int  index)

Sets the current value of the enumeration to the given item

◆ set_item_index()

LDRenum& LDRenum::set_item_index ( unsigned int  index)

Sets the current position 'index' in the label-index map


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