git-svn-id: svn://db.shs.com.ru/pip@506 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2017-05-31 14:16:24 +00:00
parent 75ea531673
commit 82c985f272
5 changed files with 145 additions and 75 deletions

View File

@@ -62,7 +62,7 @@ public:
* or \a startAllThreadedReads(). By default, read thread doesn`t start */
PIIODevice * addDevice(const PIString & full_path, PIIODevice::DeviceMode mode = PIIODevice::ReadWrite, bool start = false);
void setDeviceName(PIIODevice * dev, const PIString & name) {device_names[name] = dev;}
void setDeviceName(PIIODevice * dev, const PIString & name);
PIStringList deviceNames(const PIIODevice * dev) const;
@@ -130,7 +130,7 @@ public:
/*! \brief Add to connection channel from "name_from" to "name_to"
* \details "name_from" and "name_to" can be full pathes of devices or filter names.
* \details "name_from" and "name_to" can be full pathes of devices or device names or filter names.
* Returns \b false if there if no such device or filter, else create channel and returns \b true */
bool addChannel(const PIString & name_from, const PIString & name_to);
@@ -179,14 +179,14 @@ public:
* If "start" is true, sender is started immediately. Else, you can start sender with
* functions \a startSender()
* \n \b Attention! "frequency" is actual olny if new sender was created! */
void addSender(const PIString & name, const PIString & full_path, float frequency, bool start = false);
void addSender(const PIString & name, const PIString & full_path_name, float frequency, bool start = false);
//! Add to connection sender with name "name" device "dev"
void addSender(const PIString & name, const PIIODevice * dev, float frequency, bool start = false) {addSender(name, devFPath(dev), frequency, start);}
/*! \brief Remove from sender with name "name" device with full path "full_path_name"
* \details If there is no devices bounded to this sender, it will be removed. Returns if sender was removed */
bool removeSender(const PIString & name, const PIString & full_path);
bool removeSender(const PIString & name, const PIString & full_path_name);
//! Remove from sender with name "name" device "dev"
bool removeSender(const PIString & name, const PIIODevice * dev) {return removeSender(name, devFPath(dev));}
@@ -211,7 +211,7 @@ public:
//! Start read thread of device with full path "full_path"
void startThreadedRead(const PIString & full_path);
void startThreadedRead(const PIString & full_path_name);
//! Start read thread of device "dev"
void startThreadedRead(const PIIODevice * dev) {startThreadedRead(devFPath(dev));}
@@ -229,7 +229,7 @@ public:
void start() {startAllThreadedReads(); startAllSenders();}
//! Stop read thread of device with full path "full_path"
void stopThreadedRead(const PIString & full_path);
void stopThreadedRead(const PIString & full_path_name);
//! Stop read thread of device "dev"
void stopThreadedRead(const PIIODevice * dev) {stopThreadedRead(devFPath(dev));}
@@ -286,6 +286,8 @@ public:
PIOBJECT_SUBCLASS(DevicePool, PIThread)
friend void __DevicePool_threadReadDP(void * ddp);
friend class PIConnection;
protected:
struct DeviceData;
public:
DevicePool();
@@ -294,6 +296,7 @@ public:
bool removeDevice(PIConnection * parent, const PIString & fp);
void unboundConnection(PIConnection * parent);
PIIODevice * device(const PIString & fp) const;
DeviceData * deviceData(PIIODevice * d) const;
PIVector<PIConnection * > boundedConnections() const;
PIVector<PIIODevice * > boundedDevices() const;
PIVector<PIIODevice * > boundedDevices(const PIConnection * parent) const;
@@ -367,6 +370,7 @@ private:
PIString devPath(const PIIODevice * d) const;
PIString devFPath(const PIIODevice * d) const;
PIIODevice * devByString(const PIString & s) const;
struct Extractor {
Extractor(): extractor(0) {}