lgrEnvVar.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 
00008 
00009 #ifndef lgrEnvVar_H_
00010 #define lgrEnvVar_H_
00011 
00012 #include "lgrApp.h"
00013 #include <mtl/envObject.h>
00014 #include <vlutil/vlString.h>
00015 
00016 namespace MAKLogger
00017 {
00018 
00019    class DtAnyValue;
00020 
00022    class DT_DLL_LGRAPP DtLgrEnvVariable
00023    {
00024    public:
00025       typedef DtAnyValue* (*DtAnyValueEncoder)(const DtString&);
00026 
00028       DtLgrEnvVariable();
00029 
00031       DtLgrEnvVariable(const DtString& type,const DtString& value);
00032 
00035       explicit DtLgrEnvVariable(const DtEnvObject*);
00036 
00037       static void addDefaultTypeEncoders();
00038       static void addTypeEncoder(const DtString&,DtAnyValueEncoder encoder);
00039 
00040       void        setType(const DtString& type);
00041       DtString    type() const;
00042       void        setValue(const DtString& value);
00043       DtString    value() const;
00044 
00045       DtAnyValue* generateAnyValue() const;
00046 
00047    protected:
00048 
00049       typedef std::map<DtString,DtAnyValueEncoder> DtAnyValueEncoderMap;
00050       static DtAnyValueEncoderMap theEncoderMap;
00051 
00052       static DtAnyValue* generateStringValue(const DtString&);
00053       static DtAnyValue* generateIntegerValue(const DtString&);
00054       static DtAnyValue* generateDoubleValue(const DtString&);
00055       static DtAnyValue* generateBooleanValue(const DtString&);
00056 
00057       DtString myType;
00058       DtString myValue;
00059 
00060    };
00061 
00062 }
00063 
00064 #endif

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)