00001
00002
00003 #ifndef _PowerCrate_0_SCTDAL_0__H_
00004 #define _PowerCrate_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 PowerCard;
00019 }
00020 namespace SCTDAL {
00021 class PowerChannel;
00022 }
00023
00024 namespace SCTDAL {
00029 class PowerCrate : public virtual ::DalObject {
00030
00031 friend class ::Configuration;
00032
00033 public:
00034
00035 PowerCrate(::Configuration& conf, ::ConfigObject& obj);
00036 virtual ~PowerCrate();
00037
00045 static PowerCrate * create(::Configuration& conf, const std::string& id = "");
00046
00052 bool destroy(::Configuration& conf);
00053
00054
00055 public:
00056
00057 static const std::string s_class_name;
00058 virtual void init(bool init_children);
00059
00060
00061 private:
00062
00063 void check_init() const {if(!p_was_read) const_cast<PowerCrate*>(this)->init(false);}
00064 static void update(::Configuration& conf, const ::ConfigurationChange * change);
00065 static void reset(::Configuration& conf, bool re_initialise_obj);
00066
00067
00068 public:
00069
00070 virtual void print(unsigned int, bool, std::ostream&) const;
00071
00072
00073 private:
00074
00075 unsigned short m_id;
00076 std::vector<const SCTDAL::PowerChannel*> m_channels;
00077 std::vector<const SCTDAL::PowerCard*> m_cards;
00078
00079
00080 public:
00081
00086 unsigned short get_id() const { check_init(); return m_id; }
00087 unsigned short id() const { check_init(); return m_id; }
00088
00093 bool set_id(unsigned short value) { clear(); return p_obj.set_by_val("id", value); }
00094
00099 const std::vector<const SCTDAL::PowerChannel*>& get_channels() const { check_init(); return m_channels; }
00100 const std::vector<const SCTDAL::PowerChannel*>& channels() const { check_init(); return m_channels; }
00101
00106 bool set_channels(const std::vector<const SCTDAL::PowerChannel*>& value);
00107
00112 const std::vector<const SCTDAL::PowerCard*>& get_cards() const { check_init(); return m_cards; }
00113 const std::vector<const SCTDAL::PowerCard*>& cards() const { check_init(); return m_cards; }
00114
00119 bool set_cards(const std::vector<const SCTDAL::PowerCard*>& value);
00120
00121 };
00122
00123
00124
00125 std::ostream& operator<<(std::ostream&, const PowerCrate*);
00126 std::ostream& operator<<(std::ostream&, const PowerCrate&);
00127
00128 typedef std::vector<const PowerCrate*>::const_iterator PowerCrateIterator;
00129
00130 }
00131
00132 #endif