20.10.2013 - Modified PIObject - virtual debugName() for macro piCoutObj, improved timer measurements and timers on Windows

This commit is contained in:
peri4
2013-10-20 17:41:55 +04:00
parent 0f1b528ac6
commit ec5530053a
32 changed files with 2196 additions and 1331 deletions

View File

@@ -259,7 +259,30 @@ private:
};
inline std::ostream & operator <<(std::ostream & s, const PIConfig::Branch & v) {v.coutt(s, ""); return s;}
inline std::ostream & operator <<(std::ostream & s, const PIConfig::Entry & v) {s << v.value(); return s;}
/** \relatesalso PIConfig \relatesalso PIIODevice
* \brief Service function. useful for configuring devices
* \details Function takes entry name "name", default value "def" and two
* \a PIConfig::Entry sections: "em" and their parent "ep". If there is no
* parent ep = 0. If "ep" is not null and entry "name" exists in "ep" function
* returns this value. Else returns value of entry "name" in section "em" or
* "def" if entry doesn`t exists. \n This function useful to read settings
* from configuration file in implementation \a PIIODevice::configureDevice() function */
template<typename T>
T readDeviceSetting(const PIString & name, const T & def, const PIConfig::Entry * em, const PIConfig::Entry * ep) {
if (ep != 0) {
T ret;
bool ex;
ret = ep->getValue(name, def, &ex);
if (!ex) ret = em->getValue(name, def);
return ret;
}
return em->getValue(name, def);
}
#endif // PICONFIG_H