root/vtcross/branches/bhilburn/src/include/vtcross/components.h @ 154

Revision 154, 3.7 KB (checked in by bhilburn, 15 years ago)

Further developing the components.h file to properly define classes.

Line 
1/* Virginia Tech Cognitive Radio Open Source Systems
2 * Virginia Tech, 2009
3 *
4 * LICENSE INFORMATION GOES HERE
5 */
6
7/* This header exports the declarations for all VT-CROSS radio components.  It
8 * contains two pure abstract base classes, Component and Engine; Engine derives
9 * from Component.  All functions contained within the abstract base classes are
10 * dynamically linked and pure, and all child non-abstract classes derive using
11 * private inheritence.  Class functions of the abstract base classes are public
12 * for two reasons: (1) To allow for public/protected inheritence in other
13 * implementations, (2) So that symbolic debuggers can navigate the call tree
14 * for typecasted objects of derivative classes.
15 */
16
17#ifndef COMPONENTS_H
18#define COMPONENTS_H
19
20
21#include <stdint.h>
22
23#include "containers.h"
24
25
26class Component
27{
28    public:
29        virtual void GetRemoteComponentType(int32_t socketFD) = 0;
30        virtual void WaitForSignal(int32_t socketFD) = 0;
31        virtual void Shutdown() = 0;
32        virtual void Reset() = 0;
33        virtual void RegisterComponent(int32_t socketFD) = 0;
34        virtual void DeregisterComponent(int32_t socketFD) = 0;
35};
36
37
38class Engine : public Component
39{
40    public:
41        virtual void RegisterServices(int32_t socketFD) = 0;
42        virtual void DeregisterServices(int32_t socketFD) = 0;
43};
44
45
46class ServiceManagementLayer : public Component
47{
48    public:
49        ServiceManagementLayer();
50        ~ServiceManagementLayer();
51
52        void GetRemoteComponentType(int32_t socketFD);
53        void WaitForSignal(int32_t socketFD);
54        void Shutdown();
55        void Reset();
56        void RegisterComponent(int32_t socketFD);
57        void DeregisterComponent(int32_t socketFD);
58
59    private:
60        void TransferRadioConfiguration();
61        void TransferExperience();
62        void ReceiveServices();
63        void SetActiveMission();
64        void ListServices();
65        void ReloadConfiguration();
66        void LoadConfiguration();
67};
68
69
70class PolicyEngine : public Engine
71{
72    public:
73        PolicyEngine();
74        ~PolicyEngine();
75
76        void GetRemoteComponentType(int32_t socketFD);
77        void WaitForSignal(int32_t socketFD);
78        void Shutdown();
79        void Reset();
80        void RegisterComponent(int32_t socketFD);
81        void DeregisterComponent(int32_t socketFD);
82
83        void RegisterServices(int32_t socketFD);
84        void DeregisterServices(int32_t socketFD);
85
86    private:
87        void LoadPolicies();
88        void ReloadPolicies();
89        void SendPEDecision(int32_t socketFD, struct Parameter pList[], \
90                struct CE_Info *ce_info, int32_t decision_array[]);
91        void ValidateParameters(struct Parameter pList[], \
92                struct CE_Info *ce_info, int decision_array[]);
93};
94
95
96class CognitiveEngine : public Engine
97{
98    public:
99        CognitiveEngine();
100        ~CognitiveEngine();
101
102        void GetRemoteComponentType(int32_t socketFD);
103        void WaitForSignal(int32_t socketFD);
104        void Shutdown();
105        void Reset();
106        void RegisterComponent(int32_t socketFD);
107        void DeregisterComponent(int32_t socketFD);
108
109        void RegisterServices(int32_t socketFD);
110        void DeregisterServices(int32_t socketFD);
111
112    private:
113        void ReceiveRadioConfiguration(int32_t socketFD);
114        void ReceiveExperience(int32_t socketFD);
115        void GetSolution(Observable *observables);
116        void GetSolution(Observable *observables, std::string service);
117        void ReceiveFeedback(Observable *observables,\
118                Parameter *parameters, Utility *utilities);
119        void ReceiveFeedback(Observable *observables, \
120                Parameter *parameters, std::string service);
121};
122
123#endif
Note: See TracBrowser for help on using the browser.