Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Env_Value Class Template Reference

Enviroment Variable Value. More...

#include <Env_Value_T.h>

Collaboration diagram for ACE_Env_Value:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Env_Value (void)
 ACE_Env_Value (const ACE_TCHAR *varname, const T &vardefault)
 Constructor that calls <open>. More...

 ~ACE_Env_Value (void)
 Destroy the value. More...

 operator T (void)
 Returns the value as type T. More...

void open (const ACE_TCHAR *varname, const T &defval)
 The constructor, read <varname> from the environment, using <vardefault> as its value if it is not defined. More...

const ACE_TCHARvarname (void) const
 Returns the name of the variable being tracked. More...


Private Methods

 ACE_Env_Value (const ACE_Env_Value< T > &)
 Disallow copying and assignment. More...

ACE_Env_Value< T > operator= (const ACE_Env_Value< T > &)
void fetch_value (void)

Private Attributes

const ACE_TCHARvarname_
value_

Detailed Description

template<class T>
class ACE_Env_Value< T >

Enviroment Variable Value.

Reads a variable from the user enviroment, providing a default value.

Definition at line 39 of file Env_Value_T.h.


Constructor & Destructor Documentation

template<class T>
ACE_INLINE ACE_Env_Value< T >::ACE_Env_Value void   
 

Default constructor which isn't bound to a specific environment variable name or a default value. Before being useful it must <open>'d.

Definition at line 10 of file Env_Value_T.i.

00011   : varname_ (0)
00012 {
00013 }

template<class T>
ACE_INLINE ACE_Env_Value< T >::ACE_Env_Value const ACE_TCHAR   varname,
const T &    vardefault
 

Constructor that calls <open>.

Definition at line 16 of file Env_Value_T.i.

References ACE_TCHAR, and fetch_value.

00018   : varname_ (varname),
00019     value_(defval)
00020 {
00021   this->fetch_value ();
00022 }

template<class T>
ACE_INLINE ACE_Env_Value< T >::~ACE_Env_Value void   
 

Destroy the value.

Definition at line 49 of file Env_Value_T.i.

00050 {
00051 }

template<class T>
ACE_Env_Value< T >::ACE_Env_Value const ACE_Env_Value< T > &    [private]
 

Disallow copying and assignment.


Member Function Documentation

template<class T>
ACE_INLINE void ACE_Env_Value< T >::fetch_value void    [private]
 

Definition at line 34 of file Env_Value_T.i.

References ACE_Convert, ACE_TCHAR, ACE_OS::getenv, value_, and varname_.

Referenced by ACE_Env_Value, and open.

00035 {
00036   const ACE_TCHAR *env = ACE_OS::getenv (varname_);
00037 
00038   if (env != 0)
00039     ACE_Convert (env, value_);
00040 }

template<class T>
ACE_INLINE void ACE_Env_Value< T >::open const ACE_TCHAR   varname,
const T &    defval
 

The constructor, read <varname> from the environment, using <vardefault> as its value if it is not defined.

Definition at line 25 of file Env_Value_T.i.

References ACE_TCHAR, fetch_value, value_, varname, and varname_.

00027 {
00028   varname_ = varname;
00029   value_ = defval;
00030   this->fetch_value ();
00031 }

template<class T>
ACE_INLINE ACE_Env_Value< T >::operator T void   
 

Returns the value as type T.

Definition at line 4 of file Env_Value_T.i.

References value_.

00005 {
00006   return value_;
00007 }

template<class T>
ACE_Env_Value<T> ACE_Env_Value< T >::operator= const ACE_Env_Value< T > &    [private]
 

template<class T>
ACE_INLINE const ACE_TCHAR * ACE_Env_Value< T >::varname void    const
 

Returns the name of the variable being tracked.

Definition at line 43 of file Env_Value_T.i.

References varname_.

Referenced by open.

00044 {
00045   return varname_;
00046 }


Member Data Documentation

template<class T>
T ACE_Env_Value::value_ [private]
 

Definition at line 74 of file Env_Value_T.h.

Referenced by fetch_value, open, and operator T.

template<class T>
const ACE_TCHAR* ACE_Env_Value::varname_ [private]
 

Definition at line 73 of file Env_Value_T.h.

Referenced by fetch_value, open, and varname.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:47:39 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002