{
namespace Service
{
+
+ /**
+ * @class BundleActivator
+ * @brief This class represents Bundle to be activated by container
+ *
+ */
class BundleActivator
{
- public:
- BundleActivator();
- virtual ~BundleActivator();
- virtual void activateBundle(ResourceContainerBundleAPI *resourceContainer,
- std::string bundleId);
- virtual void deactivateBundle();
+ public:
+
+ /**
+ * Constructor for BundleActivator
+ */
+ BundleActivator();
+
+ /**
+ * Virtual destructor for BundleActivator
+ */
+ virtual ~BundleActivator();
+
+ /**
+ * Activate the Bundle to make bundle work and create bundle resources
+ *
+ * @param resourceContainer - resourceContainer which registered the bundle
+ *
+ * @param bundleId - assigned id for the bundle
+ *
+ * @return void
+ */
+ virtual void activateBundle(ResourceContainerBundleAPI *resourceContainer,
+ std::string bundleId);
+
+ /**
+ * Deactivate the Bundle to stop working and destroy bundle resources
+ *
+ * @return void
+ */
+ virtual void deactivateBundle();
};
}
}
{
namespace Service
{
+
+ /**
+ * @class BundleResource
+ * @brief This class represents Basic bundle resource template
+ * to be registered in the container and make resource server
+ *
+ */
class BundleResource
{
public:
+
+ /**
+ * Constructor for BundleResource
+ */
BundleResource();
+
+ /**
+ * Virtual destructor for BundleResource
+ */
virtual ~BundleResource();
- // TODO use type variant mechanism
+ /**
+ * Execute the logic of bundle to get the value of attribute
+ *
+ * @param attributeName - name of attribute to get
+ *
+ * @return string - return value of the attribute
+ *
+ * @todo use type variant mechanism
+ */
virtual string getAttribute(string attributeName);
+
+ /**
+ * Execute the logic of bundle to set the value of attribute
+ *
+ * @param attributeName - name of attribute to set
+ *
+ * @param value - value of attribute to set
+ *
+ * @return void
+ */
virtual void setAttribute(string attributeName, string value);
+
+ /**
+ * Return the list of attribute names of the resource
+ *
+ * @return std::list - return list of the attribute names
+ */
std::list<string> getAttributeNames();
+
+ /**
+ * Initialize attributes of the resource
+ *
+ * @return void
+ */
virtual void initAttributes() = 0;
+ /**
+ * Register notification receiver(resource container) to notify for the changes of attributes
+ *
+ * @param pNotiReceiver - Notification Receiver to get notification from bundle resource
+ *
+ * @return void
+ */
void registerObserver(NotificationReceiver *pNotiReceiver);
public:
{
namespace Service
{
+
+ /**
+ * @class NotificationReceiver
+ * @brief This class represents Notification Receiver to get notification
+ * from bundle resources if there's any changes of attribute state
+ *
+ */
class NotificationReceiver
{
public:
+
+ /**
+ * Constructor for NotificationReceiver
+ */
NotificationReceiver() {};
+
+ /**
+ * destructor for NotificationReceiver
+ */
~NotificationReceiver() {};
+ /**
+ * Callback method for getting notification from bundle resources
+ *
+ * @return void
+ */
virtual void onNotificationReceived(std::string strResourceUri) = 0;
};
}
{
namespace Service
{
+
+ /**
+ * @class ProtocolBridgeConnector
+ * @brief This class represents connector for Protocol Bridge
+ * to
+ *
+ */
class ProtocolBridgeConnector
{
- public:
- ProtocolBridgeConnector();
- virtual ~ProtocolBridgeConnector();
- virtual void connect() = 0;
- virtual void disconnect() = 0;
+ public:
+
+ /**
+ * Constructor for ProtocolBridgeConnector
+ */
+ ProtocolBridgeConnector();
+
+ /**
+ * Virtual destructor for ProtocolBridgeConnector
+ */
+ virtual ~ProtocolBridgeConnector();
+
+ /**
+ * Execute the logic needed for connection with diffrent protocol from IoTivity
+ *
+ * @return void
+ */
+ virtual void connect() = 0;
+
+ /**
+ * Execute the logic needed for disconnection with diffrent protocol from IoTivity
+ *
+ * @return void
+ */
+ virtual void disconnect() = 0;
};
}
}
{
namespace Service
{
+
+ /**
+ * @class ProtocolBridgeResource
+ * @brief This class represents bundle resource template for Protocol Bridge
+ * to be registered in the container and make resource server
+ *
+ */
class ProtocolBridgeResource: public BundleResource
{
- public:
- ProtocolBridgeResource();
- virtual ~ProtocolBridgeResource();
- virtual string getAttribute(string attributeName) = 0;
- virtual void setAttribute(string attributeName, string value) = 0;
+ public:
+
+ /**
+ * Constructor for ProtocolBridgeResource
+ */
+ ProtocolBridgeResource();
+
+ /**
+ * Virtual destructor for ProtocolBridgeResource
+ */
+ virtual ~ProtocolBridgeResource();
+
+ /**
+ * Execute the logic of bundle to get the value of attribute
+ *
+ * @param attributeName - name of attribute to get
+ *
+ * @return string - return value of the attribute
+ *
+ * @todo use type variant mechanism
+ */
+ virtual string getAttribute(string attributeName) = 0;
+
+ /**
+ * Execute the logic of bundle to set the value of attribute
+ *
+ * @param attributeName - name of attribute to set
+ *
+ * @param value - value of attribute to set
+ *
+ * @return void
+ */
+ virtual void setAttribute(string attributeName, string value) = 0;
};
}
}
class ResourceContainerBundleAPI: public NotificationReceiver
{
public:
+
+ /**
+ * Constructor for ResourceContainerBundleAPI
+ */
ResourceContainerBundleAPI();
+
+ /**
+ * Virtual destructor for ResourceContainerBundleAPI
+ */
virtual ~ResourceContainerBundleAPI();
+
+ /**
+ * Register bundle resource in the container
+ * and register resource server for bundle resource
+ *
+ * @param resource - bundle resource to register
+ *
+ * @return void
+ */
virtual void registerResource(BundleResource *resource) = 0;
+
+ /**
+ * Unregister bundle resource from the container
+ * and unregister resource server
+ *
+ * @param resource - bundle resource to unregister
+ *
+ * @return void
+ */
virtual void unregisterResource(BundleResource *resource) = 0;
+
+ /**
+ * Get Configuration data of certain bundle
+ *
+ * @param [in] bundleId - bundle id to get configuration data
+ *
+ * @param [out] configOutput - returned configuration data
+ *
+ * @return void
+ */
virtual void getBundleConfiguration(std::string bundleId, configInfo *configOutput) = 0;
+
+ /**
+ * Get the list of Configuration data of resources that certain bundle has
+ *
+ * @param [in] bundleId - bundle id to get configuration data
+ *
+ * @param [out] configOutput - returned resource configuration data vector
+ *
+ * @return void
+ */
virtual void getResourceConfiguration(std::string bundleId,
std::vector< resourceInfo > *configOutput) = 0;
+ /**
+ * API for getting an instance of ResourceContainerBundleAPI
+ *
+ * @return ResourceContainerBundleAPI * - return the object pointer of ResourceContainerBundleAPI
+ */
static ResourceContainerBundleAPI *getInstance();
};
}
{
namespace Service
{
+
+ /**
+ * @class SoftSensorResource
+ * @brief This class represents bundle resource for Soft Sensor
+ * to be registered in the container and make resource server
+ *
+ */
class SoftSensorResource: public BundleResource
{
public:
vector< map< string, string > > data;
};
+ /**
+ * Constructor for SoftSensorResource
+ */
SoftSensorResource();
+
+ /**
+ * Virtual destructor for SoftSensorResource
+ */
virtual ~SoftSensorResource();
+ /**
+ * Execute the logic of bundle to get the value of attribute
+ *
+ * @param attributeName - name of attribute to get
+ *
+ * @return string - return value of the attribute
+ *
+ * @todo use type variant mechanism
+ */
virtual string getAttribute(string attributeName) = 0;
+
+ /**
+ * Execute the logic of bundle to set the value of attribute
+ *
+ * @param attributeName - name of attribute to set
+ *
+ * @param value - value of attribute to set
+ *
+ * @return void
+ */
virtual void setAttribute(string attributeName, string value) = 0;
+ /**
+ * Set Input data to update output value of the soft sensor
+ *
+ * @param inputs - input data which soft sensor needed
+ *
+ * @return void
+ */
virtual void setInputAttribute(SensorData inputs) = 0;
+
int inputCount;
vector<string> m_vecInputAttributes;
map< string, SensorData > m_mapStoredInputData;