00001 #ifndef EDG_WORKLOAD_COMMON_CONFIGURATION_MODULETYPE_H
00002 #define EDG_WORKLOAD_COMMON_CONFIGURATION_MODULETYPE_H
00003
00004 #include <vector>
00005 #include <string>
00006
00007 #include "edg/workload/common/common_namespace.h"
00008
00009 COMMON_NAMESPACE_BEGIN {
00010
00011 namespace configuration {
00012
00013 class ModuleType {
00014 public:
00015 enum module_type { unknown,
00016 network_server,
00017 workload_manager,
00018 job_controller,
00019 log_monitor,
00020 last_module
00021 };
00022
00023 ModuleType( module_type type = unknown );
00024 ModuleType( const std::string &type );
00025 ModuleType( const char *type );
00026
00027 ~ModuleType( void );
00028
00029 inline module_type get_codetype( void ) const { return( this->mt_code ); }
00030 inline const std::string &get_stringtype( void ) const { return( this->mt_name ); }
00031
00032 inline ModuleType &set_module( module_type type ) { this->setType( type ); return( *this ); }
00033 inline ModuleType &set_module( const std::string &type ) { this->setType( type ); return( *this ); }
00034 inline ModuleType &set_module( const char *type ) { this->setType( std::string(type) ); return( *this ); }
00035
00036 static const std::string &module_name( module_type code );
00037 static module_type module_code( const std::string &name );
00038
00039 private:
00040 void setType( module_type type );
00041 void setType( const std::string &type );
00042
00043 module_type mt_code;
00044 std::string mt_name;
00045
00046 static std::vector<std::string> mt_s_names;
00047 };
00048
00049 };
00050
00051 } COMMON_NAMESPACE_END;
00052
00053 #endif
00054
00055
00056
00057