CMS 3D CMS Logo

Public Member Functions | Private Attributes

envSwitch Class Reference

#include <envUtil.h>

List of all members.

Public Member Functions

 envSwitch (const char *envName)
 constructor from env var name
const bool & getEnv () const
 return the value
const std::string & name () const
 operator const bool & () const
 return the value
envSwitchoperator= (bool b)
 assignement operator (change the value...)

Private Attributes

std::string envName_
bool it

Detailed Description

a bool controlled by envvar

Definition at line 71 of file envUtil.h.


Constructor & Destructor Documentation

envSwitch::envSwitch ( const char *  envName)

constructor from env var name

Definition at line 41 of file envUtil.cc.

                                         :  envName_(envName),
                                              it(::getenv(envName)!=0) {}

Member Function Documentation

const bool& envSwitch::getEnv ( ) const [inline]

return the value

Definition at line 85 of file envUtil.h.

References it.

{ return it;}
const std::string& envSwitch::name ( void  ) const [inline]

Definition at line 87 of file envUtil.h.

References envName_.

{ return envName_;}
envSwitch::operator const bool & ( ) const [inline]

return the value

Definition at line 82 of file envUtil.h.

References it.

{ return it;}
envSwitch& envSwitch::operator= ( bool  b) [inline]

assignement operator (change the value...)

Definition at line 78 of file envUtil.h.

References b, and it.

{ it=b; return *this;}

Member Data Documentation

std::string envSwitch::envName_ [private]

Definition at line 91 of file envUtil.h.

Referenced by name().

bool envSwitch::it [private]

Definition at line 92 of file envUtil.h.

Referenced by getEnv(), operator const bool &(), and operator=().