/** * @file include/ActivMiddleware/ActivFramework/ThinApplication.h * * @brief Header file for thin application class. */ #if (!defined ACTIV_FRAMEWORK_THIN_APPLICATION_H) #define ACTIV_FRAMEWORK_THIN_APPLICATION_H #include "ActivMiddleware/ActivFramework/External.h" #include "ActivMiddleware/ActivFramework/Application.h" #include "ActivMiddleware/ActivFramework/RouterService.h" //! Activ namespace. namespace Activ { /** * @brief Thin application class. * * The ThinApplication class should be used when linking to an existing shared memory system. It provides * access to always on agent services. */ class ThinApplication : public Application { public: //! Settings. class Settings : public Application::Settings { public: //! Default constructor. ACTIV_FRAMEWORK_API Settings(); /** * @brief Read settings from an ini file section. * * @param iniFileParser ini file. * * @throw Exception */ ACTIV_FRAMEWORK_API void Read(const IniFileParser &iniFileParser); IHeap::Settings m_applicationHeapSettings; ///< Settings for application heap. Default: use system heap. Boost::optional m_routerServiceSettings; ///< Settings for optional local RouterService. }; /** * @brief Constructor. * * @param settings the Settings object to use. * @param timeout how long to wait for the system to exist, in ms. * @param componentId the component id. * * @throw Exception. */ ACTIV_FRAMEWORK_API ThinApplication(const Settings &settings, Timeout &timeout = Timeout::GetInfinite(), const String &componentId = defaultComponentId); //! Destructor. ACTIV_FRAMEWORK_API virtual ~ThinApplication() ACTIV_OVERRIDE; /** * @brief Make UiComponent for the process-local RouterService. * * @param parentUiComponent UiComponent that will allow switching to the RouterService's ui. * * @return shared_ptr to the UiComponent, or null if there is no process-local RouterService. */ ACTIV_FRAMEWORK_API CxxYZ::shared_ptr MakeRouterServiceUiComponent(const UiComponent &parentUiComponent); protected: ACTIV_FRAMEWORK_API virtual StatusCode OnMessage(HeapMessage &message) ACTIV_OVERRIDE; private: class Private; Boost::scoped_ptr m_pPrivate; ///< Hidden implementation details. }; } // namespace Activ #endif // (!defined ACTIV_FRAMEWORK_THIN_APPLICATION_H)