00001 #include <config/ConfigObject.h>
00002 #include <config/Change.h>
00003 #include "RodModule.h"
00004
00005 namespace SCTDAL {
00006 const std::string RodModule::s_class_name("RodModule");
00007
00008
00009
00010 RodModule::RodModule(::Configuration& db, ::ConfigObject& o) :
00011 DalObject(db, o),
00012 RodRModule(db, o)
00013 {
00014 }
00015
00016
00017 void RodModule::print(unsigned int indent, bool print_header, std::ostream& s) const
00018 {
00019 std::string str(indent, ' ');
00020
00021 if(print_header) {
00022 s
00023 << str << "SCTDAL RodModule object:\n"
00024 << str << " id: \'" << UID() << "\', class name: \'" << class_name() << "\'\n";
00025 }
00026
00027
00028
00029
00030 SCTDAL::RodRModule::print(indent, false, s);
00031
00032
00033
00034
00035 s << str << " group: " << group() << std::endl;
00036 }
00037
00038
00039 std::ostream&
00040 operator<<(std::ostream& s, const RodModule * obj)
00041 {
00042 s << '\'';
00043
00044 if(obj == 0) {
00045 s << "(null)";
00046 }
00047 else {
00048 obj->config_object().print_ptr(s);
00049 }
00050 s << '\'';
00051
00052 return s;
00053 }
00054
00055
00056 std::ostream&
00057 operator<<(std::ostream& s, const RodModule & obj)
00058 {
00059 if(&obj == 0) {
00060 s << "(null)";
00061 }
00062 else {
00063 obj.print(0, true, s);
00064 }
00065
00066 return s;
00067 }
00068
00069
00070 void RodModule::update(::Configuration& conf, const ::ConfigurationChange * change)
00071 {
00072 conf.update<RodModule>(change->get_modified_objs(), change->get_removed_objs());
00073 }
00074
00075
00076 void RodModule::reset(::Configuration& conf, bool re_initialise_obj)
00077 {
00078 conf.reset_objects<RodModule>(re_initialise_obj);
00079 }
00080
00081
00082 void RodModule::init(bool init_children)
00083 {
00084 RodRModule::init(init_children);
00085 static const char * env = ::getenv("TDAQ_REPORT_DAL_OBJECT_READ");
00086 if(env) { std::cout << "DEBUG: read object " << this << std::endl; }
00087
00088 if(!p_obj.get("group",m_group)) {
00089 std::cerr << "ERROR: could not find attribute 'group'\n";
00090 }
00091 else {
00092 p_db.convert(m_group, p_obj, "group");
00093 }
00094
00095 p_obj.clear();
00096 }
00097
00098 RodModule::~RodModule()
00099 {
00100 }
00101
00102 }