val_Element< ET > Class Template Reference
[Parser for config files; validation]

#include <val.h>

Inheritance diagram for val_Element< ET >:

Inheritance graph
[legend]
Collaboration diagram for val_Element< ET >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<class ET>
class val_Element< ET >

Definition at line 43 of file val.h.


Public Member Functions

 val_Element ()
 val_Element (ET a_val)
 val_Element (ET a_low, ET a_high)
const ET & Val () const
const ET & Low () const
const ET & High () const
const ElemType_eType () const
void Val (const ET a_val)
void Range (const ET a_low, const ET a_high)

Private Attributes

ElemType_e m_type
ET m_val
ET m_high

Constructor & Destructor Documentation

template<class ET>
val_Element< ET >::val_Element (  )  [inline]

Definition at line 47 of file val.h.

00048             : m_type(el_Unknown) {
00049             // Empty
00050         }

template<class ET>
val_Element< ET >::val_Element ( ET  a_val  )  [inline]

Definition at line 52 of file val.h.

00053         : m_type(el_Simple),
00054           m_val(a_val) {
00055             // Empty
00056         }

template<class ET>
val_Element< ET >::val_Element ( ET  a_low,
ET  a_high 
) [inline]

Definition at line 58 of file val.h.

00059         : m_type(el_Range),
00060           m_val(a_low),
00061           m_high(a_high) {
00062             // Empty
00063         }


Member Function Documentation

template<class ET>
const ET& val_Element< ET >::Val (  )  const [inline]

Definition at line 65 of file val.h.

00065                               {
00066             if (m_type == el_Simple ||
00067                 m_type == el_Range) {
00068                 return m_val;
00069             }
00070             else {
00071                 throw ivd_Error(ie_PARSER_ERROR, "Can not return Val for Unknown Element");
00072             }
00073         }

template<class ET>
const ET& val_Element< ET >::Low (  )  const [inline]

Definition at line 75 of file val.h.

00075                               {
00076             return Val();
00077         }

template<class ET>
const ET& val_Element< ET >::High (  )  const [inline]

Definition at line 79 of file val.h.

00079                                {
00080             if (m_type == el_Range) {
00081                 return m_high;
00082             }
00083             else {
00084                 throw ivd_Error(ie_PARSER_ERROR, "Can not return High for simple/unknown Element");
00085             }
00086         }

template<class ET>
const ElemType_e& val_Element< ET >::Type (  )  const [inline]

Definition at line 88 of file val.h.

00088                                        {
00089             return m_type;
00090         }

template<class ET>
void val_Element< ET >::Val ( const ET  a_val  )  [inline]

Definition at line 92 of file val.h.

00092                                  {
00093             if (m_type == el_Range) {
00094                 throw ivd_Error(ie_PARSER_ERROR, "Trying to change Element from Range to Simple ");
00095             }
00096             else {
00097                 if (m_type == el_Unknown) {
00098                     m_type = el_Simple;
00099                 }
00100                 m_val = a_val;
00101            }
00102         }

template<class ET>
void val_Element< ET >::Range ( const ET  a_low,
const ET  a_high 
) [inline]

Definition at line 104 of file val.h.

00104                                                     {
00105             if (m_type == el_Simple) {
00106                 throw ivd_Error(ie_PARSER_ERROR, "Trying to change Element from Simple to Range ");
00107             }
00108             else {
00109                 if (m_type == el_Unknown) {
00110                     m_type = el_Range;
00111                 }
00112                 m_val = a_low;
00113                 m_high = a_high;
00114            }
00115         }


Member Data Documentation

template<class ET>
ElemType_e val_Element< ET >::m_type [private]

Definition at line 118 of file val.h.

template<class ET>
ET val_Element< ET >::m_val [private]

Definition at line 119 of file val.h.

template<class ET>
ET val_Element< ET >::m_high [private]

Definition at line 120 of file val.h.


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

Generated on Mon Feb 27 19:51:33 2012 for OPENARCHIVE by  doxygen 1.5.6