00001
00002
00003 #ifndef _PowerCard_0_SCTDAL_0__H_
00004 #define _PowerCard_0_SCTDAL_0__H_
00005
00006 #include <iostream>
00007 #include <string>
00008 #include <map>
00009 #include <vector>
00010
00011 #include <config/Configuration.h>
00012 #include <config/DalObject.h>
00013
00014
00015
00016
00017 namespace SCTDAL {
00018 class PowerParam;
00019 }
00020
00021 namespace SCTDAL {
00026 class PowerCard : public virtual ::DalObject {
00027
00028 friend class ::Configuration;
00029
00030 public:
00031
00032 PowerCard(::Configuration& conf, ::ConfigObject& obj);
00033 virtual ~PowerCard();
00034
00042 static PowerCard * create(::Configuration& conf, const std::string& id = "");
00043
00049 bool destroy(::Configuration& conf);
00050
00051
00052 public:
00053
00054 static const std::string s_class_name;
00055 virtual void init(bool init_children);
00056
00057
00058 private:
00059
00060 void check_init() const {if(!p_was_read) const_cast<PowerCard*>(this)->init(false);}
00061 static void update(::Configuration& conf, const ::ConfigurationChange * change);
00062 static void reset(::Configuration& conf, bool re_initialise_obj);
00063
00064
00065 public:
00066
00067 virtual void print(unsigned int, bool, std::ostream&) const;
00068
00069
00070 private:
00071
00072 unsigned short m_id;
00073 std::string m_type;
00074 std::vector<const SCTDAL::PowerParam*> m_params;
00075
00076
00077 public:
00078
00083 unsigned short get_id() const { check_init(); return m_id; }
00084 unsigned short id() const { check_init(); return m_id; }
00085
00090 bool set_id(unsigned short value) { clear(); return p_obj.set_by_val("id", value); }
00091
00096 const std::string& get_type() const { check_init(); return m_type; }
00097 const std::string& type() const { check_init(); return m_type; }
00098
00103 bool set_type(const std::string& value) { clear(); return p_obj.set_enum("type", value); }
00104
00109 const std::vector<const SCTDAL::PowerParam*>& get_params() const { check_init(); return m_params; }
00110 const std::vector<const SCTDAL::PowerParam*>& params() const { check_init(); return m_params; }
00111
00116 bool set_params(const std::vector<const SCTDAL::PowerParam*>& value);
00117
00118 };
00119
00120
00121
00122 std::ostream& operator<<(std::ostream&, const PowerCard*);
00123 std::ostream& operator<<(std::ostream&, const PowerCard&);
00124
00125 typedef std::vector<const PowerCard*>::const_iterator PowerCardIterator;
00126
00127 }
00128
00129 #endif