-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathServiceComponent.hpp
61 lines (53 loc) · 2.3 KB
/
ServiceComponent.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* \file common/src/ServiceComponent.hpp
* \brief Declaration of the service component.
**/
#pragma once
#include "areg/base/GEGlobal.h"
#include "areg/component/Component.hpp"
#include "examples/00_helloservice/services/HelloServiceStub.hpp"
//////////////////////////////////////////////////////////////////////////
// ServiceComponent declaration
//////////////////////////////////////////////////////////////////////////
class ServiceComponent : public Component
, protected HelloServiceStub
{
//////////////////////////////////////////////////////////////////////////
// static methods
//////////////////////////////////////////////////////////////////////////
public:
/**
* \brief Called to instantiate the service component when loading the model.
* \param entry Indicates the component description entry from Registry.
* \param owner The component owning thread.
**/
static Component * CreateComponent( const NERegistry::ComponentEntry & entry, ComponentThread & owner );
/**
* \brief Called when unloading model to delete service component.
**/
static void DeleteComponent( Component & compObject, const NERegistry::ComponentEntry & entry );
protected:
ServiceComponent(const NERegistry::ComponentEntry & entry, ComponentThread & owner);
virtual ~ServiceComponent(void) = default;
//////////////////////////////////////////////////////////////////////////
// HelloService Interface Requests
//////////////////////////////////////////////////////////////////////////
/**
* \brief The request to output a greeting.
* \param client The name of the client to output the greeting.
**/
virtual void requestHelloService( const String & client ) override;
//////////////////////////////////////////////////////////////////////////
// Hidden function calls
//////////////////////////////////////////////////////////////////////////
private:
//!< The wrapper of this pointer.
inline ServiceComponent & self( void )
{ return (*this); }
//////////////////////////////////////////////////////////////////////////
// Forbidden calls
//////////////////////////////////////////////////////////////////////////
private:
ServiceComponent( void ) = delete;
DECLARE_NOCOPY_NOMOVE( ServiceComponent );
};