Commit f6b00c14f5a2fe2b351d01b9a2ecba3c7792b9cb

  • avatar
  • Sergey 'Jin' Bostandzhyan <jin @deve…per.digitalstrom.org>
  • Wed Jul 21 12:26:55 CEST 2010
Made subsystem name == thread name

Removed redundant parameter from the ThreadedSubsystem constructor.
core/ds485/businterfacehandler.cpp
(1 / 1)
  
4343 //================================================== BusInterfaceHandler
4444
4545 BusInterfaceHandler::BusInterfaceHandler(DSS* _pDSS, ModelMaintenance& _apartment)
46 : ThreadedSubsystem(_pDSS, "BusInterfaceHandler", "BusInterfaceHandler"),
46 : ThreadedSubsystem(_pDSS, "BusInterfaceHandler"),
4747 m_ModelMaintenance(_apartment)
4848 {}
4949
core/metering/fake_meter.cpp
(1 / 1)
  
3535
3636namespace dss {
3737 FakeMeter::FakeMeter(DSS* _pDSS)
38 : ThreadedSubsystem(_pDSS, "FakeMeter", "FakeMeter")
38 : ThreadedSubsystem(_pDSS, "FakeMeter")
3939 {
4040 m_Config.reset(new MeteringConfigChain(false, 1, "mW"));
4141 m_Config->setComment("Consumption in mW");
core/metering/metering.cpp
(1 / 1)
  
4343 //================================================== Metering
4444
4545 Metering::Metering(DSS* _pDSS)
46 : ThreadedSubsystem(_pDSS, "Metering", "Metering"),
46 : ThreadedSubsystem(_pDSS, "Metering"),
4747 m_pMeteringBusInterface(NULL)
4848 {
4949 getDSS().getPropertySystem().setStringValue(getConfigPropertyBasePath() + "storageLocation", getDSS().getWebrootDirectory() + "metering/", true);
core/model/modelmaintenance.cpp
(1 / 1)
  
4949namespace dss {
5050
5151 ModelMaintenance::ModelMaintenance(DSS* _pDSS)
52 : ThreadedSubsystem(_pDSS, "Apartment", "Apartment"),
52 : ThreadedSubsystem(_pDSS, "Apartment"),
5353 m_IsInitializing(true),
5454 m_pApartment(NULL),
5555 m_pMetering(NULL)
core/subsystem.h
(1 / 1)
  
7171
7272 class ThreadedSubsystem: public Subsystem, protected Thread {
7373 public:
74 ThreadedSubsystem(DSS* _pDSS, const std::string& _name, const char* _threadName) : Subsystem(_pDSS, _name), Thread(_threadName) {}
74 ThreadedSubsystem(DSS* _pDSS, const std::string& _name) : Subsystem(_pDSS, _name), Thread(_name) {}
7575 virtual void shutdown() { Thread::terminate(); }
7676 bool isRunning() { return Thread::isRunning(); }
7777 };
core/thread.h
(5 / 3)
  
2929#include <windows.h>
3030#endif
3131
32#include <string>
33
3234namespace dss {
3335
3436/** Wrapper for pthread- and Windows threads
4343#else
4444 HANDLE m_ThreadHandle;
4545#endif
46 const char* m_Name;
46 std::string m_Name;
4747 bool m_FreeAtTermination;
4848 bool m_Running;
4949protected:
5050 bool m_Terminated;
5151public:
5252 /** Constructs a thread with the given name */
53 Thread(const char* _name = NULL);
53 Thread(std::string _name = "");
5454
5555 virtual ~Thread();
5656
7474 bool isRunning() const { return m_Running; }
7575
7676 /** Returns the name of the thread that got passed to the constructor */
77 const char* getThreadIdentifier() { return m_Name; }
77 std::string &getThreadIdentifier() { return m_Name; }
7878private:
7979 virtual void cleanup() {}
8080}; // Thread
unix/thread.cpp
(3 / 3)
  
4141
4242 thObj->execute();
4343
44 if(thObj->getThreadIdentifier() != NULL) {
44 if(!thObj->getThreadIdentifier().empty()) {
4545 Logger::getInstance()->log(std::string("Destroying thread: ") + thObj->getThreadIdentifier());
4646 } else {
4747 Logger::getInstance()->log("Destroying thread: (no name)");
5454} // threadStarterHelpFunc
5555
5656
57Thread::Thread(const char* _name )
57Thread::Thread(std::string _name )
5858 : m_ThreadHandle( 0 ),
5959 m_Name( _name ),
6060 m_FreeAtTermination( false ),
7676bool Thread::run() {
7777 assert( !m_Running );
7878 m_Running = true;
79 if( m_Name != NULL ) {
79 if( !m_Name.empty() ) {
8080 Logger::getInstance()->log(std::string("creating thread for \"") + m_Name + "\"");
8181 }
8282#ifndef WIN32
webservices/webservices.cpp
(1 / 1)
  
3434 //================================================== WebServices
3535
3636 WebServices::WebServices(DSS* _pDSS)
37 : ThreadedSubsystem(_pDSS, "WebServices", "WebServices")
37 : ThreadedSubsystem(_pDSS, "WebServices")
3838 {
3939
4040 } // ctor