Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
titleMockContainerServices.h
class MockContainerServices : public maci::ContainerServices {
  public:
    MockContainerServices(ACE_CString& componentName, PortableServer::POA_ptr poa);
    ~MockContainerServices();
    virtual CORBA::Object* getCORBAComponent(const char* name);
//... Other methods omitted for simplicity
    template<class TAdvancedObject>TObject> void activateComponent(const char* name) {
        TAdvancedObjectTObject* obj = new TAdvancedObjectTObject(name, this);
        obj->initialize();
        obj->execute();
        this->comps[name] = obj
    };
    virtual deactivateComponent(const char* name) {
        acscomponent::ACSComponentImpl* obj = dynamic_cast<acscomponent::ACSComponentImpl*>(this->comps[name]);
        try {
            obj->cleanUp();
        } catch (...) {
            obj->aboutToAbort();
        }
        this->comps.erase(name);
    }
  protected:
    std::map<std::string, CORBA::Object_var> comps;
};

...