Public Member Functions | Private Attributes

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.

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

Detailed Description

template<class ET>
class val_Element< ET >

Definition at line 57 of file val.h.


Constructor & Destructor Documentation

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

Definition at line 61 of file val.h.

            : m_type(el_Unknown) {
            // Empty
        }

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

Definition at line 66 of file val.h.

        : m_type(el_Simple),
          m_val(a_val) {
            // Empty
        }

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

Definition at line 72 of file val.h.

        : m_type(el_Range),
          m_val(a_low),
          m_high(a_high) {
            // Empty
        }


Member Function Documentation

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

Definition at line 93 of file val.h.

                               {
            if (m_type == el_Range) {
                return m_high;
            }
            else {
                throw ivd_Error(ie_PARSER_ERROR, "Can not return High for simple/unknown Element");
            }
        }

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

Definition at line 89 of file val.h.

                              {
            return Val();
        }

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

Definition at line 118 of file val.h.

                                                    {
            if (m_type == el_Simple) {
                throw ivd_Error(ie_PARSER_ERROR, "Trying to change Element from Simple to Range ");
            }
            else {
                if (m_type == el_Unknown) {
                    m_type = el_Range;
                }
                m_val = a_low;
                m_high = a_high;
           }
        }

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

Definition at line 102 of file val.h.

                                       {
            return m_type;
        }

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

Definition at line 106 of file val.h.

                                 {
            if (m_type == el_Range) {
                throw ivd_Error(ie_PARSER_ERROR, "Trying to change Element from Range to Simple ");
            }
            else {
                if (m_type == el_Unknown) {
                    m_type = el_Simple;
                }
                m_val = a_val;
           }
        }

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

Definition at line 79 of file val.h.

                              {
            if (m_type == el_Simple ||
                m_type == el_Range) {
                return m_val;
            }
            else {
                throw ivd_Error(ie_PARSER_ERROR, "Can not return Val for Unknown Element");
            }
        }


Member Data Documentation

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

Definition at line 134 of file val.h.

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

Definition at line 132 of file val.h.

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

Definition at line 133 of file val.h.


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