- Timestamp:
- 11/13/09 15:37:02 (15 years ago)
- Location:
- vtcross/trunk/src/include/vtcross
- Files:
-
- 12 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/include/vtcross/cbr.h
r509 r518 15 15 */ 16 16 17 /* This file contains the full implementation of the CBR class - the default 18 * VTCROSS case-based reasoner. 17 /*! This header contains the declaration and a full implementation of 18 * the CBR class - the default CROSS case-based reasoner, which can be used as a 19 * backend for cognitive engines. 19 20 */ 20 21 … … 39 40 40 41 41 #define DATABASENAME " vtcross_cbr"42 #define DATABASENAME "cross_cbr" 42 43 43 44 44 45 /* This is an internal debugging function used by some sqlite3 function calls. 45 * It is not used otherwise in the VTCROSS codebase. */46 int32_t 47 callback(void *notUsed, int argc, char **argv, char **azColName)46 * It is not used otherwise in the CROSS codebase. */ 47 int32_t 48 callback(void *notUsed, int32_t argc, char **argv, char **azColName) 48 49 { 49 50 for(size_t i = 0; i < argc; i++) { … … 56 57 57 58 58 /* The CBR class is designed to used as either as-is, or as a parent class. All 59 /*! \brief Case-Based Reasoner class declaration. 60 * 61 * The CBR class is designed to used as either as-is, or as a parent class. All 59 62 * functions are declared virtual, and internal members are 'protected' rather 60 63 * than private. If you require functionality in a CBR not specifically provided … … 66 69 { 67 70 public: 68 /* Constructors for the CBR class. Note that the default constructor 71 /*! \brief Constructors for the CBR class. 72 * 73 * Note that the default constructor 69 74 * must be defined inline here so that super-calls from child classes 70 75 * don't fail (i.e. we cannot rely on the compiler-provided constructor. */ … … 74 79 string _primcols[], uint32_t _len, uint32_t _primlen); 75 80 76 /* Destructor for the CBR class. Note that this destructor will be 81 /*! \brief Destructors for the CBR class. 82 * 83 * Destructor for the CBR class. Note that this destructor will be 77 84 * called automatically by any derived classes, and so child classes 78 85 * should not repeat the freeing actions performed in this function. */ 79 86 virtual ~CBR(); 80 87 81 /* This function opens the VTCROSS database, or if it has not been 88 /*! \brief Open/Create a sqlite database for the CBR. 89 * 90 * This function opens the CROSS database, or if it has not been 82 91 * created yet, creates it. */ 83 92 virtual int32_t OpenDatabase(); 84 93 85 /* Execute a sqlite3 command and return the sqlite3 return code. */ 94 /*! \brief Execute a sqlite command. 95 * 96 * Construct and execute a sqlite3 command and pass the return code back. */ 86 97 virtual int32_t ExecuteCommand(); 87 98 88 /* Execute a sqlite3 search command and store the results in the passed 99 /*! \brief Search the sqlite3 database. 100 * 101 * Execute a sqlite3 search command and store the results in the passed 89 102 * retvals argument. */ 90 103 virtual int32_t ExecuteSearchCommand(float *_retvals); 91 104 92 /* Print the VTCROSS sqlite3database. */105 /*! \brief Print the CROSS sqlite database. */ 93 106 virtual void Print(); 94 107 95 /* Search the VTCROSS database for specific fields and store the results 108 /*! \brief Search the CBR database. 109 * 110 * Search the CROSS database for specific fields and store the results 96 111 * in the passed retvals argument. */ 97 112 virtual int32_t Search(string _names[], int32_t *_ops, float *_vals, \ … … 101 116 float *_retvals); 102 117 103 /* Update a row in the VTCROSS sqlite3 database.*/118 /*! \brief Update an entry in the CBR database. */ 104 119 virtual int32_t Update(string _where[], string _set[], float *_wherevals, \ 105 120 float *_setvals, uint32_t _wherelen, uint32_t _setlen); 106 121 107 /* Add a row to the VTCROSS sqlite3 database. */122 /*! \brief Add a row to the CROSS sqlite3 database. */ 108 123 virtual int32_t AddRow(string _cols[], float *_vals, uint32_t _len); 109 124 … … 129 144 130 145 /* Generate the command that will create the initial table within the 131 * VTCROSS database. */146 * CROSS database. */ 132 147 command = "CREATE TABLE " + tablename + "("; 133 148 for(size_t i = 0; i < numColumns; i++) { … … 159 174 160 175 /* Generate the command that will create the initial table within the 161 * VTCROSS database with primary keys. */176 * CROSS database with primary keys. */ 162 177 command = "CREATE TABLE " + tablename + "("; 163 178 for(size_t i = 0; i < numColumns; i++) { -
vtcross/trunk/src/include/vtcross/cognitive_engine.h
r465 r518 15 15 */ 16 16 17 /* This header exports the declaration for the Cognitive Engine component type.17 /*! This header exports the declaration for the Cognitive Engine component type. 18 18 */ 19 19 … … 25 25 26 26 27 /* Cognitive Engine class declaration. All public functions are inherited from 28 * parent classes. 27 /*! \brief Cognitive Engine class declaration. 28 * 29 * All public functions are inherited from parent classes. Please see parent 30 * class definitions for function documentation. 29 31 */ 30 32 class CognitiveEngine : public Engine 31 33 { 32 34 public: 35 /*! Default constructor. */ 33 36 CognitiveEngine(); 37 38 /*! Default destructor. */ 34 39 ~CognitiveEngine(); 35 40 36 /* Overloaded constructor that creates a cognitive engine object and 41 /*! \brief Preferred constructor. 42 * 43 * Overloaded constructor that creates a cognitive engine object and 37 44 * connects it to either the shell or an SML, depening on the SML bool. 38 45 */ … … 53 60 54 61 private: 55 /* Receive the transmitted radio configuration from the radio itself 56 * (the CE will not always be local to the radio). 57 */ 62 /*! \brief Receive radio XML configuration. 63 * 64 * Receive the transmitted radio configuration from the radio itself 65 * (the CE will not always be local to the radio). This gets passed 66 * through either the Shell or the SML. */ 58 67 void ReceiveRadioConfiguration(); 59 68 60 /* Receive an 'experience' report from the radio. 61 */ 69 /*! \brief Receive an 'experience' report from the radio. 70 * 71 * An experience report can be used to build the transmission history 72 * for a CE just starting up so that it has a moving start regarding 73 * parameter optimization. */ 62 74 void ReceiveExperience(); 63 75 64 /* Find the most optimal set of transmission parameters given certain 76 /*! \brief Request that the CE optimize a set of parameters. 77 * 78 * Find the most optimal set of transmission parameters given certain 65 79 * observables and possibly a service if the SML component is present 66 * and active. 67 */68 Parameter *GetSolution(Observable *observables,Parameter *currentParameters);69 Parameter *GetSolution(Observable *observables, Parameter *currentParameters,\70 std::string service);80 * and active. */ 81 Parameter *GetSolution(Observable *observables, \ 82 Parameter *currentParameters); 83 Parameter *GetSolution(Observable *observables, \ 84 Parameter *currentParameters, std::string service); 71 85 72 /* Receive a feedback from the radio regarding the performance of a 86 /*! \brief Receive feedback from the radio 87 * 88 * Receive a feedback from the radio regarding the performance of a 73 89 * certain set of parameters, possibly associated with a service. 74 90 * … … 78 94 * more accurate performance statistics. 79 95 */ 80 void ReceiveFeedback(Observable *observables,\ 81 Parameter *parameters); 82 void ReceiveFeedback(Observable *observables, \ 83 Parameter *parameters, std::string service); 96 void ReceiveFeedback(Observable *observables,Parameter *parameters); 97 void ReceiveFeedback(Observable *observables, Parameter *parameters, \ 98 std::string service); 84 99 85 100 86 /* BuildCognitiveEngine performs the CE implementation specific work 101 /*! \brief Initialize the CE and prepare it for operation. 102 * 103 * BuildCognitiveEngine performs the CE implementation specific work 87 104 * that defines the internals of a CE. For example, a CBR CE engine 88 105 * would build the case-base reasoner or create the database, a neural … … 92 109 void BuildCognitiveEngine(); 93 110 94 /* The SML_present bool reflects whether or not the remote component 111 /*! \brief Keept track of what this CE is connected to. 112 * 113 * The SML_present bool reflects whether or not the remote component 95 114 * this object is connected to is an SML. If it isn't, then it must be 96 115 * a shell. The socketFD stores the socket file descriptor for this -
vtcross/trunk/src/include/vtcross/common.h
r411 r518 15 15 */ 16 16 17 /* This file is included in every source file of the VTCROSS system. It 18 * declares global flags and includes. 19 */ 17 /*! This file is included in every source file of the CROSS system. It 18 * declares global flags and includes. */ 20 19 21 20 #ifndef COMMON_H -
vtcross/trunk/src/include/vtcross/components.h
r465 r518 15 15 */ 16 16 17 /* This header exports the base declarations for all VT-CROSS radio components. 18 * It contains two pure abstract base classes, Component and Engine; Engine derives 19 * from Component. All functions contained within the abstract base classes are 20 * dynamically linked and pure, and all child non-abstract classes derive using 21 * private inheritence. Class functions of the abstract base classes are public 22 * for two reasons: (1) To allow for public/protected inheritence in other 23 * implementations, (2) So that symbolic debuggers can navigate the call tree 24 * for typecasted objects of derivative classes. 17 /*! This header exports the base declarations for all CROSS radio components. 18 * 19 * It contains two pure abstract base classes, Component and Engine; Engine 20 * derives from Component. All functions contained within the abstract base 21 * classes are dynamically linked and pure, and all child non-abstract classes 22 * derive using private inheritence. Class functions of the abstract base 23 * classes are public for two reasons: (1) To allow for public/protected 24 * inheritence in other implementations, (2) So that symbolic debuggers can 25 * navigate the call tree for typecasted objects of derivative classes. 25 26 * 26 27 * Note that any new component type declaration MUST include this header and … … 40 41 41 42 42 /* Component abstract base class that all component classes should inherit from, 43 /*! \brief The Component class is the top-level abstract base class in CROSS. 44 * 45 * Component abstract base class that all component classes should inherit from, 43 46 * including cognitive and policy engines, and the service management layer. 44 47 * Defines only functions required by all component types. … … 47 50 { 48 51 public: 49 /* Asks the component at the passed socket FD for its component type 52 /*! \brief Asks a component to identify itself. 53 * 54 * Asks the component at the passed socket FD for its component type 50 55 * string. Note that this implementation is global for all component 51 56 * types, so is implemented here. Should a component need to override … … 63 68 } 64 69 65 /* Send an indentfying string for this object's component type in 70 /*! \brief Responds to a request for identification. 71 * 72 * Send an indentfying string for this object's component type in 66 73 * response to a GetRemoteComponentType query. 67 74 */ 68 75 virtual void SendComponentType() = 0; 69 76 70 /* Completely shutdown the radio and all operations. 71 */ 77 /*! \brief Shutdown the component. */ 72 78 virtual void Shutdown() = 0; 73 79 74 /* Reset the radio and reload all configuration files. 75 * 76 * TODO are we remembering experiences in CEs? 77 */ 80 /*! \brief Reset the component and reload configurations. */ 78 81 virtual void Reset() = 0; 79 82 80 /* Register or deregister a component with the primary radio shell. 81 */ 83 /*! \brief Compenent registration procedures. */ 82 84 virtual void RegisterComponent() = 0; 83 85 virtual void DeregisterComponent() = 0; … … 85 87 86 88 87 /* Engine abstract base class from which all engine component types should 89 /*! \brief Engine abstract base class declaration. 90 * 91 * Engine abstract base class from which all engine component types should 88 92 * inherit (e.g. cognitive and policy engines). Inherits all functions from the 89 93 * ABC Component publically. … … 92 96 { 93 97 public: 94 /* Connect to the remote control component, which will always be either 95 * the VTCROSS shell or SML. Based on the status of the SML_present 98 /*! \brief Connect to a remote controlling component. 99 * 100 * Connect to the remote control component, which will always be either 101 * the CROSS shell or SML. Based on the status of the SML_present 96 102 * bool, this function will also register the component or services. 97 103 * 98 104 * TODO I feel like the name of this function could be changed to be a 99 * little more descriptive? 100 */ 105 * little more descriptive? */ 101 106 virtual void ConnectToRemoteComponent(const char* serverName, \ 102 107 const char* serverPort, const bool SML) = 0; 103 108 104 /* Wait for a command signal containing task instructions. 105 */ 109 /*! \brief Wait for a command signal containing task instructions. 110 * 111 * This is the general run-time loop from which all radio operation 112 * occurs. Once the Engine has started up and initialized, it will 113 * remain in this function until it receives a command to perform some 114 * action. */ 106 115 virtual void WaitForSignal() = 0; 107 116 108 /* Register or deregister services that this engine provides with the 109 * service management layer. 110 */ 117 /*! \brief Functions for interacting with the service management layer. 118 * 119 * Register or deregister services that this engine provides with the 120 * service management layer. */ 111 121 virtual void RegisterServices() = 0; 112 122 virtual void DeregisterServices() = 0; -
vtcross/trunk/src/include/vtcross/containers.h
r411 r518 15 15 */ 16 16 17 /* This header contains commonly used data container structs in VT-CROSS17 /*! This header contains commonly used data container structs in CROSS 18 18 * systems. 19 19 */ … … 28 28 29 29 30 /* TODO30 /*! TODO 31 31 * 32 32 */ … … 41 41 42 42 43 /* TODO43 /*! TODO 44 44 * 45 45 */ … … 53 53 54 54 55 /* TODO55 /*! TODO 56 56 * 57 57 */ … … 62 62 63 63 64 /* TODO64 /*! TODO 65 65 * 66 66 */ … … 77 77 78 78 79 /* TODO79 /*! TODO 80 80 * 81 81 */ … … 88 88 89 89 90 /* TODO90 /*! TODO 91 91 * 92 92 */ … … 102 102 103 103 104 /* TODO104 /*! TODO 105 105 * 106 106 */ … … 114 114 }; 115 115 116 /* Registration data for Cognitive Engines for use in communication116 /*! Registration data for Cognitive Engines for use in communication. 117 117 */ 118 118 struct CE_Reg { -
vtcross/trunk/src/include/vtcross/cross_shell.h
r465 r518 15 15 */ 16 16 17 /* This header exports the declaration for the VTCROSS Shell component, which is18 * a critical part of every VTCROSS system.17 /*! This header exports the declaration for the CROSS Shell component, which is 18 * a critical part of every CROSS system. 19 19 */ 20 20 … … 26 26 27 27 28 /* Cognitive Radio Shell class declaration. 28 /*! \brief Cognitive Radio Shell class declaration. 29 * 30 * The CROSS Cognitive Radio Shell (CRS) is the central control component of 31 * most CROSS radios. It is a requirement for any CROSS radio, regardless of 32 * the presence or lack thereof of the SML. 29 33 */ 30 34 class CognitiveRadioShell 31 35 { 32 36 public: 37 /*! \brief Default CRS costructor. */ 33 38 CognitiveRadioShell(); 39 40 /*! \brief Default CRS destructor. */ 34 41 ~CognitiveRadioShell(); 35 42 36 /* Overloaded constructor that creates a CR Shell object and loads the 43 /*! \brief Preferred CRS constructor. 44 * 45 * Overloaded constructor that creates a CR Shell object and loads the 37 46 * passed radio configuration XML file. 38 47 */ … … 40 49 int16_t policyPort, int16_t commandPort); 41 50 42 /* Ask for the component type of a remote component via sockets, or 43 * respond to such a query sent to the shell itself. 44 */ 51 /*! \brief Request the component type of a remote component. */ 45 52 std::string GetRemoteComponentType(int32_t socketFD); 53 54 /*! \brief Respond to a request to identify component type. */ 46 55 void SendComponentType(int32_t socketFD); 47 56 57 /*! \brief Shutdown the CRS. 58 * 59 * Since the CRS is the central control component of the CROSS radio, 60 * shutting down the CRS will shutdown the entire radio. 61 */ 48 62 void Shutdown(); 63 64 /*! \brief Restart the CRS. 65 * 66 * Restart the CRS component - reloads configuration files, and 67 * re-initializes the CRS component. 68 */ 49 69 void Reset(); 50 70 51 /* Start all the socket servers */ 71 /*! \brief Start the CRS's socket server. 72 * 73 * This function will make the CRS create a socket server and begin 74 * listening for incoming connections from other components. 75 */ 52 76 void StartShellServer(); 53 77 78 /*! \brief Load the radio configuration. 79 * 80 * This function reads in the radio's XML configuration file, which is 81 * typically located on the same system as the CRS, although it can also 82 * be passed to the CRS from the radio host platform if necessary. 83 */ 54 84 int32_t LoadRadioConfiguration(const char* radioConfig, Parameter* &pList, \ 55 85 Utility* &uList, Observable* &oList, Radio_Info* radioInfo); 56 86 private: 57 /* Parse and load/reload policies into the policy engine. 58 */ 59 void LoadPolicies(); 60 void ReloadPolicies(); 61 62 /* Register and Deregister the different components. 87 /*! \brief Handle component registration activities. 88 * 89 * Register and Deregister the different components. 90 * TODO Are multiple functions really necessary? They are all basically 91 * doing the same thing... 63 92 */ 64 93 void RegisterCognitiveEngine(int32_t socketFD); … … 69 98 void DeregisterSML(int32_t socketFD); 70 99 100 /*! \brief Set the active mission. 101 * 102 * This function handles a request by the radio host platform to set or 103 * change the current active mission in the service management layer. 104 * This command is basically passed through the CRS to the SML. 105 */ 71 106 void SetActiveMission(int32_t socketFD); 72 107 … … 75 110 int32_t HandleMessage(int32_t socketFD); 76 111 77 /* Send optimization request to primary port FD. 112 /*! \brief Send optimization request to CE. 113 * 114 * The host application requested that parameters be optimized - pass 115 * the parameters and command to the CE. 116 * 117 * TODO How is the CE being selected if multiple CEs are available? 78 118 */ 79 119 void GetOptimalParameters(int32_t socketFD); 80 120 81 /* TODO121 /*! TODO 82 122 */ 83 123 bool SendRadioConfiguration(int32_t socketFD); 84 124 bool SendRadioExperience(int32_t socketFD); 85 125 86 /* TODO126 /*! TODO 87 127 */ 88 128 bool UpdateParameterPerformance(int32_t socketFD); 89 129 90 /* TODO130 /*! TODO 91 131 */ 92 132 bool SML_present; … … 94 134 bool CE_present; 95 135 96 /* TODO136 /*! TODO 97 137 */ 98 138 int32_t numberOfCognitiveEngines; 99 139 100 /* TODO140 /*! TODO 101 141 */ 102 142 int16_t primaryPort; … … 104 144 int16_t commandPort; 105 145 106 /* TODO 146 /*! TODO 147 * 148 * I'm confused as to what exactly these are for... there can be 149 * multiple CEs and PEs, and the CRS _IS_ the command component. 150 * --BCH 107 151 */ 108 152 int32_t ceSocketFD; … … 110 154 int32_t policySocketFD; 111 155 112 /* TODO156 /*! TODO 113 157 */ 114 158 Utility *utils; … … 116 160 Observable *observables; 117 161 118 /* TODO162 /*! TODO 119 163 */ 120 164 struct Radio_Info *radio_info; -
vtcross/trunk/src/include/vtcross/debug.h
r436 r518 15 15 */ 16 16 17 /* DESCRIPTION OF FILE. 17 /*! This header defines macros for log functions and debug statements. 18 * Generally, it is recommended that this header be included in every source 19 * file. The functions included in this file should be used rather than 20 * hard-coding 'printf's or 'cout's in your code. 18 21 */ 19 22 -
vtcross/trunk/src/include/vtcross/error.h
r411 r518 15 15 */ 16 16 17 /* DESCRIPTION OF FILE. 17 /*! This header defines macros for printing to standard error out. The macros 18 * in this file should be used rather than printing to stderr with fprintf or 19 * exiting with a hard-coded 'exit' call. 18 20 */ 19 21 -
vtcross/trunk/src/include/vtcross/libvtcross.h
r498 r518 15 15 */ 16 16 17 /* VTCROSS Cognitive Radio API17 /*! CROSS Cognitive Radio API 18 18 * 19 * This header exports all public functions that comprise the VTCROSS function 20 * library. 19 * This header exports all public functions that comprise the CROSS function 20 * library. These are the functions that are used by the host application to 21 * control the CROSS radio. 21 22 * 22 23 * PUT MORE STUFF HERE 23 24 */ 24 25 25 #ifndef LIB VTCROSS_H26 #define LIB VTCROSS_H26 #ifndef LIBCROSS_H 27 #define LIBCROSS_H 27 28 28 29 #include <stdint.h> … … 33 34 34 35 35 /* Sets the location of the shell component that the client code will be 36 /*! \brief Tell the system where the Shell component is located. 37 * 38 * Sets the location of the shell component that the client code will be 36 39 * communicating with. Note that this can be a local or remote destination. 37 40 */ … … 39 42 40 43 41 /* Parses VTCROSSXML configuration file and uses it to configure the radio.44 /*! \brief Parses XML configuration file and uses it to configure the radio. 42 45 * 43 46 * This function *must* be called when the radio first starts up, and may be … … 47 50 48 51 49 /* Lists current radio configuration options loaded from the configuration XML 50 * file. 52 /*! \brief Lists current radio configuration options loaded from the XML. 51 53 * 52 54 * TODO How are we listing these? Are we simply returning them to stdout? … … 56 58 57 59 58 /* View data from the current status of the radio.60 /*! \brief View data from the current status of the radio. 59 61 * 60 62 * This function allows client code to capture radio properties at any certain … … 68 70 69 71 70 /* View components currently connected to the radio by id.72 /*! \brief View components currently connected to the radio by id. 71 73 * 72 74 * TODO Should there be another way to list components? If you have 10 cognitive … … 79 81 80 82 81 /* Look up component information by id.83 /*! \brief Look up component information by id. 82 84 * 83 85 * Note that the return type is of abstract base class component, which can then … … 87 89 88 90 89 /* Given a certain set of observables, ask the radio to find the optimum radio90 * parameters and return them.91 /*! \brief Given a certain set of observables, ask the radio to find the 92 * optimum radio parameters and return them. 91 93 * 92 94 * TODO I'm a little confused about this function... why would anyone need to … … 97 99 98 100 99 /* Update the radio regarding its performance for a certain set of transmission 100 * parameters, observables, and utilities. 101 /*! \brief Update the radio regarding its performance. 101 102 * 102 * TODO Where in the function parameters are we accurately representing the 103 * radio's performance? 103 * TODO 104 104 */ 105 105 bool UpdateParameterPerformance(Parameter *p, uint32_t numParameters, Observable *o, \ 106 106 uint32_t numObservables); 107 107 108 /* Deactivate/Activate/Disconnect a component by id.108 /*! \brief Deactivate/Activate/Disconnect a component by id. 109 109 */ 110 110 bool ActivateComponent(uint32_t id); … … 112 112 bool DisconnectComponent(uint32_t id); 113 113 114 /*! \brief Set the active mission of the CROSS radio. 115 */ 114 116 uint32_t SetActiveMission(char * activeMission); 115 117 116 /* Shut down the radio.118 /*! \brief Shut down the radio. 117 119 * 118 120 * This function will deactivate and disconnect all radio components before … … 121 123 bool Shutdown(); 122 124 123 /* Return total number of currently recognized transmission parameters.125 /*! \brief Return total number of currently recognized transmission parameters. 124 126 */ 125 127 uint32_t GetNumParameters(); -
vtcross/trunk/src/include/vtcross/policy_engine.h
r465 r518 15 15 */ 16 16 17 /* This header exports the declaration for the Policy Engine component type.17 /*! This header exports the declaration for the Policy Engine component type. 18 18 */ 19 19 … … 25 25 26 26 27 /* Policy Engine class declaration. All public functions are inherited from 28 * parent classes. 27 /*! \brief Policy Engine class declaration. 28 * 29 * All public functions are inherited from parent classes Engine and Component. 30 * Please see those class documentation files for further information regarding 31 * public functions. 29 32 */ 30 33 class PolicyEngine : public Engine 31 34 { 32 35 public: 36 /*! \brief Default Policy Engine Constructor */ 33 37 PolicyEngine(); 38 39 /*! \brief Default Policy Engine Destructor */ 34 40 ~PolicyEngine(); 35 41 36 /* Overloaded constructor that creates a policy engine object and 42 /*! \brief Preferred Policy Engine Constructor. 43 * 44 * Overloaded constructor that creates a policy engine object and 37 45 * connects it to either the shell or an SML, depening on the SML bool. 38 46 */ … … 53 61 54 62 private: 55 /* Parse and load/reload policies into the policy engine. 56 */ 63 /*! \brief Parse and load/reload policies into the policy engine. */ 57 64 void LoadPolicies(); 58 65 void ReloadPolicies(); 59 66 60 /* Return a decision made by the policy engine regarding a certain set 67 /*! \brief Return a validation decision. 68 * 69 * Return a decision made by the policy engine regarding a certain set 61 70 * of transmission parameters. 62 71 */ … … 64 73 int32_t decision_array[]); 65 74 66 /* Validate a set of transmission parameters received from the radio. 75 /*! \brief Perform parameter validation. 76 * 77 * Validate a set of transmission parameters received from the radio. 67 78 */ 68 79 void ValidateParameters(); 69 80 70 /* The SML_present bool reflects whether or not the remote component 81 /*! \brief Keep track of what control component this PE is connected to. 82 * 83 * The SML_present bool reflects whether or not the remote component 71 84 * this object is connected to is an SML. If it isn't, then it must be 72 85 * a shell. The socketFD stores the socket file descriptor for this -
vtcross/trunk/src/include/vtcross/service_management_layer.h
r465 r518 15 15 */ 16 16 17 /* This header exports the declaration for the Service Management Layer17 /*! This header exports the declaration for the Service Management Layer 18 18 * component. 19 19 */ … … 26 26 27 27 28 /* Service Management Layer (SML) class declaration. The functions listed here 29 * are required by the VTCROSS API for service-oriented VTCROSS radio 30 * architectures. 28 /*! \brief Service Management Layer (SML) class declaration. 29 * 30 * The functions listed here are required by the CROSS API for 31 * service-oriented CROSS radio architectures. Note that most public functions 32 * are documented in the parent class, Component. 31 33 */ 32 34 class ServiceManagementLayer : public Component 33 35 { 34 36 public: 37 /*! \brief Default SML Constructor. */ 35 38 ServiceManagementLayer(); 39 40 /*! \brief Default SML Destructor. */ 36 41 ~ServiceManagementLayer(); 37 42 38 /* Overloaded constructor that creates an SML and connects it to the 43 /*! \brief Preferred SML Constructor. 44 * 45 * Overloaded constructor that creates an SML and connects it to the 39 46 * shell with the passed hostname and port. 40 47 */ … … 42 49 const char* serverPort, int16_t clientPort); 43 50 44 /* Connect and register with the shell component at the passed hostname 51 /*! \brief Connect the SML to a remote Shell control component. 52 * 53 * Connect and register with the shell component at the passed hostname 45 54 * and port. 46 55 */ 47 56 void ConnectToShell(const char* serverName, const char* serverPort); 57 48 58 void SendComponentType(); 49 59 void MessageHandler(int32_t ID); … … 53 63 void DeregisterComponent(); 54 64 55 /* Starts the SML Server and watches it for incoming messages 65 /*! \brief Starts the SML Server and watches it for incoming messages 66 * 67 * TODO 56 68 */ 57 69 void StartSMLServer(); 58 70 59 71 private: 60 /* Receive the radio configuration settings from the shell and pass them 72 /*! \brief Pass the radio configuration onto another component. 73 * 74 * Receive the radio configuration settings from the shell and pass them 61 75 * on to another component. 62 76 */ 63 77 void TransferRadioConfiguration(int32_t ID); 64 78 65 /* Receive information regarding a completed 'experience' and pass it on 79 /*! \brief Pass a radio experience onto another component. 80 * 81 * Receive information regarding a completed 'experience' and pass it on 66 82 * to the appropriate cognitive engine. 67 83 */ 68 84 void TransferExperience(int32_t ID); 69 85 70 /* Listen for other components registering their available services with86 /*! Listen for other components registering their available services with 71 87 * the SML. 72 88 */ … … 74 90 void DeregisterServices(int32_t ID); 75 91 76 /* Change the active mission of the radio to a new one and adjust radio92 /*! Change the active mission of the radio to a new one and adjust radio 77 93 * behavoir appropriately. 78 94 */ 79 95 void SetActiveMission(); 80 96 81 /* TODO97 /*! TODO 82 98 */ 83 99 void RegisterCognitiveEngine(int32_t ID); 84 100 void DeregisterCognitiveEngine(int32_t ID); 85 101 86 /* List all services provided to the radio by registered components.102 /*! List all services provided to the radio by registered components. 87 103 */ 88 104 void ListServices(); 89 105 90 /* Load/Relead the XML configuration file.106 /*! Load/Relead the XML configuration file. 91 107 */ 92 108 void ReloadConfiguration(); 93 109 void LoadConfiguration(const char *SML_Config, Mission* &mList); 94 110 95 /* Create and initialize the DB to hold the services111 /*! Create and initialize the DB to hold the services 96 112 */ 97 113 void CreateServicesDB(); 98 114 void CreateDataDB(); 99 115 100 /* TODO116 /*! TODO 101 117 */ 102 118 void PerformActiveMission(); 103 119 void TransactData(int32_t sourceID); 104 120 105 /* The socket file descriptor information for the shell which this SML121 /*! The socket file descriptor information for the shell which this SML 106 122 * is connected to. 107 123 */ 108 124 int32_t shellSocketFD; 109 125 110 /* TODO126 /*! TODO 111 127 */ 112 128 int16_t CEPort; -
vtcross/trunk/src/include/vtcross/socketcomm.h
r411 r518 15 15 */ 16 16 17 /* TODO DESCRIPTION OF FILE. 17 /*! This file describes the interface to libsocketcomm, which is the internal 18 * socket communication library that CROSS radios use to communicate between 19 * components. 18 20 */ 19 21 … … 26 28 27 29 28 /* TODO30 /*! TODO 29 31 */ 30 32 int32_t ReadMessage(int32_t socketFD, char *msgBuffer); 31 33 32 /* TODO34 /*! TODO 33 35 */ 34 36 int32_t SendMessage(int32_t socketFD, const char *message) ; 35 37 36 /* TODO38 /*! TODO 37 39 */ 38 40 int32_t GetParameter(int32_t socketFD, struct Parameter pList[], \ 39 41 struct Radio_Info *radio_info); 40 42 41 /* TODO43 /*! TODO 42 44 */ 43 45 int32_t GetRequest(int32_t socketFD, struct Parameter pList[], \ 44 46 struct Radio_Info *radio_info); 45 47 46 /* This is the original function that does what the above function is supposed48 /*! This is the original function that does what the above function is supposed 47 49 * to do. 48 50 */ 49 51 int32_t ClientSocket(const char *serverName, const char *portNumber); 50 52 51 /* TODO53 /*! TODO 52 54 */ 53 55 int32_t AcceptTCPConnection(int32_t servSock); 54 56 55 /* TODO57 /*! TODO 56 58 */ 57 59 int32_t CreateTCPServerSocket(uint16_t port); 58 60 59 /* TODO61 /*! TODO 60 62 */ 61 63 int32_t InitializeTCPServerPort(int32_t servSock);