#ifndef COMPONENT_H #define COMPONENT_H #include #include #include #include #include namespace sscl { class ComponentThread; class PuppetThread; /** EXPLANATION: * Components are API-exposing sub-components of an application. They are used * aggregate the resources and API of some logically distinct sub-system into * a single abstract entity. Basically, a component is a way to bind some APIs * and resources to a particular thread. Ideally, all accesses to the resources * of a component should be made through the component's APIs. * * Multiple components can share the same thread; and for this reason, each * component must be supplied with a reference to the thread it shares. * This amounts to saying that a single thread may expose and serve multiple * APIs. */ class Component { public: Component(const std::shared_ptr &thread); ~Component() = default; public: std::shared_ptr thread; public: }; class PuppetComponent : public Component { public: PuppetComponent( PuppetApplication &parent, const std::shared_ptr &thread); ~PuppetComponent() = default; public: PuppetApplication &parent; }; namespace pptr { class PuppeteerComponent : public Component { public: PuppeteerComponent(const std::shared_ptr &thread); ~PuppeteerComponent() = default; }; } // namespace pptr } // namespace sscl #endif // COMPONENT_H