wip
This commit is contained in:
@@ -51,11 +51,10 @@ LightDevice::~LightDevice(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn operator[]
|
||||
*
|
||||
* @brief to access to a specific light opbject.
|
||||
* @brief to access to a specific light object.
|
||||
*/
|
||||
Light& LightDevice::operator[](int a_pos)
|
||||
{
|
||||
|
||||
@@ -51,6 +51,50 @@ ShutterDevice::~ShutterDevice(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn operator[]
|
||||
*
|
||||
* @brief to access to a specific shutter object.
|
||||
*/
|
||||
Shutter& ShutterDevice::operator[] (int a_pos)
|
||||
{
|
||||
return m_shutters[a_pos];
|
||||
}
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn size
|
||||
*
|
||||
* @brief return the size of the shutter devices.
|
||||
*/
|
||||
uint16_t ShutterDevice::size(void)
|
||||
{
|
||||
return m_shutters.size();
|
||||
}
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn size
|
||||
*
|
||||
* @brief return the size of the light devices.
|
||||
*/
|
||||
int ShutterDevice::find(int a_pos)
|
||||
{
|
||||
std::vector<Shutter>::iterator the_shutter_it;
|
||||
int the_status = -1;
|
||||
int the_pos = 0;
|
||||
|
||||
for (the_shutter_it = m_shutters.begin(); the_shutter_it != m_shutters.end(); the_shutter_it++)
|
||||
{
|
||||
if ((*the_shutter_it).get_id() == a_pos)
|
||||
{
|
||||
return the_pos;
|
||||
}
|
||||
|
||||
the_pos++;
|
||||
}
|
||||
|
||||
return the_status;
|
||||
}
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn from_json
|
||||
*
|
||||
|
||||
@@ -41,6 +41,12 @@ class ShutterDevice : public Device
|
||||
ShutterDevice(void);
|
||||
~ShutterDevice(void);
|
||||
|
||||
Shutter& operator[](int a_pos);
|
||||
|
||||
uint16_t size(void);
|
||||
|
||||
int find(int a_pos);
|
||||
|
||||
int from_json(struct json_object *a_node);
|
||||
struct json_object *to_json(void);
|
||||
|
||||
|
||||
@@ -42,6 +42,12 @@ class SprinklerDevice : public Device
|
||||
SprinklerDevice(void);
|
||||
~SprinklerDevice(void);
|
||||
|
||||
Sprinkler& operator[](int a_pos);
|
||||
|
||||
uint16_t size(void);
|
||||
|
||||
int find(int a_pos);
|
||||
|
||||
int from_json(struct json_object *a_node);
|
||||
struct json_object *to_json(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user