Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[r1]: trunk / Cm / Cm.Core / ConversionTable.hpp Maximize Restore History

Download this file

ConversionTable.hpp    32 lines (25 with data), 920 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef CM_CORE_CONVERSIONTABLE_INCLUDED
#define CM_CORE_CONVERSIONTABLE_INCLUDED
#include <Cm.Core/Function.hpp>
namespace Cm { namespace Core {
class ConversionTable;
typedef boost::shared_ptr<ConversionTable> ConversionTablePtr;
class ConversionTable: public Entity
{
public:
static void Init();
static void Done();
static ConversionTablePtr Instance();
void AddConversion(const FunctionPtr& conversion);
FunctionPtr GetConversion(const String& sourceTypeName, const String& targetTypeName) const;
private:
static ConversionTablePtr instance;
typedef boost::unordered_map<String, FunctionPtr> ConversionMap;
typedef ConversionMap::const_iterator ConversionMapIt;
ConversionMap conversionMap;
ConversionTable();
};
void ConversionTableInit();
void ConversionTableDone();
} } // namespoace Cm::Core
#endif // CM_CORE_CONVERSIONTABLE_INCLUDED