Commit 4d1ad77e authored by Pavel Vainerman's avatar Pavel Vainerman

Небольшая чистка от лишних include, добавление недостающих и т.п.

parent dd9fe9fb
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "ujson.h" #include "ujson.h"
#include "LogDB.h" #include "LogDB.h"
#include "Configuration.h" #include "Configuration.h"
#include "Exceptions.h"
#include "Debug.h" #include "Debug.h"
#include "UniXML.h" #include "UniXML.h"
#include "LogDBSugar.h" #include "LogDBSugar.h"
......
...@@ -9,7 +9,7 @@ using namespace std; ...@@ -9,7 +9,7 @@ using namespace std;
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
typedef std::pair<std::string, std::string> LogInfo; typedef std::pair<std::string, std::string> LogInfo;
const size_t maxRead = 5000; // сколько читать прежде чем записать в БД const size_t maxRead = 5000; // сколько читать прежде чем записать в БД
std::vector<std::string> qbuf; static std::vector<std::string> qbuf;
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
void saveToDB( SQLiteInterface* db ); void saveToDB( SQLiteInterface* db );
void parseLine( SQLiteInterface* db, const LogInfo& loginfo, const std::string& line ); void parseLine( SQLiteInterface* db, const LogInfo& loginfo, const std::string& line );
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <string> #include <string>
#include <sys/wait.h> #include <sys/wait.h>
#include "Configuration.h" #include "Configuration.h"
#include "Exceptions.h"
#include "Extensions.h" #include "Extensions.h"
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
using namespace std; using namespace std;
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include <string> #include <string>
#include "UniSetTypes.h" #include "UniSetTypes.h"
#include "Exceptions.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
namespace uniset namespace uniset
{ {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#define Object_LT_H_ #define Object_LT_H_
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#include <deque> #include <deque>
#include "Debug.h"
#include "UniSetTypes.h" #include "UniSetTypes.h"
#include "MessageType.h" #include "MessageType.h"
#include "PassiveTimer.h" #include "PassiveTimer.h"
......
...@@ -253,8 +253,8 @@ namespace uniset ...@@ -253,8 +253,8 @@ namespace uniset
ConfirmMessage( const ConfirmMessage& ) noexcept = default; ConfirmMessage( const ConfirmMessage& ) noexcept = default;
ConfirmMessage& operator=( const ConfirmMessage& ) noexcept = default; ConfirmMessage& operator=( const ConfirmMessage& ) noexcept = default;
ObjectId sensor_id; /* ID датчика (события) */ ObjectId sensor_id = { uniset::DefaultObjectId }; /* ID датчика (события) */
double sensor_value; /* значение датчика (события) */ double sensor_value = { 0.0 }; /* значение датчика (события) */
struct timespec sensor_time = { 0, 0 }; /* время срабатывания датчика(события), который квитируем */ struct timespec sensor_time = { 0, 0 }; /* время срабатывания датчика(события), который квитируем */
struct timespec confirm_time = { 0, 0 }; /* * время прошедшее до момента квитирования */ struct timespec confirm_time = { 0, 0 }; /* * время прошедшее до момента квитирования */
......
...@@ -31,8 +31,8 @@ namespace uniset ...@@ -31,8 +31,8 @@ namespace uniset
class ObjectIndex class ObjectIndex
{ {
public: public:
ObjectIndex() {}; ObjectIndex() {}
virtual ~ObjectIndex() {}; virtual ~ObjectIndex() {}
// info // info
// \return nullptr if not found // \return nullptr if not found
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
#ifndef _TCPCheck_H_ #ifndef TCPCheck_H_
#define _TCPCheck_H_ #define TCPCheck_H_
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
#include <atomic> #include <atomic>
#include "ThreadCreator.h" #include "ThreadCreator.h"
...@@ -55,5 +55,5 @@ namespace uniset ...@@ -55,5 +55,5 @@ namespace uniset
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
} // end of uniset namespace } // end of uniset namespace
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
#endif // _TCPCheck_H_ #endif // TCPCheck_H_
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -113,7 +113,7 @@ namespace uniset ...@@ -113,7 +113,7 @@ namespace uniset
lmpBLINK3 = 4 /*!< мигать */ lmpBLINK3 = 4 /*!< мигать */
}; };
static const long ChannelBreakValue = std::numeric_limits<long>::max(); const long ChannelBreakValue = std::numeric_limits<long>::max();
class IDList class IDList
{ {
......
...@@ -16,10 +16,12 @@ ...@@ -16,10 +16,12 @@
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#ifndef WDTInterface_H_ #ifndef WDTInterface_H_
#define WDTInterface_H_ #define WDTInterface_H_
/* /* DEPRECATED!!!
Для всех станций кроме GUI используется драйвер wdt686.o и девайс /dev/wdt с мажером 208 и минором 0 * \todo нужно либо выкинуть, либо сделать нормальный расширяемый интерфейс
для GUI используется i810-tco, а девайс /dev/watchdog создаваемый через мискдевайс(?) *
*/ * Для всех станций кроме GUI используется драйвер wdt686.o и девайс /dev/wdt с мажером 208 и минором 0
* для GUI используется i810-tco, а девайс /dev/watchdog создаваемый через мискдевайс(?)
*/
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#include <string> #include <string>
namespace uniset namespace uniset
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <fstream> #include <fstream>
#include <unistd.h> #include <unistd.h>
#include "IORFile.h" #include "IORFile.h"
#include "Exceptions.h"
#include "Configuration.h" #include "Configuration.h"
#include "ORepHelpers.h" #include "ORepHelpers.h"
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include <omniORB4/CORBA.h> #include <omniORB4/CORBA.h>
#include <omniORB4/omniURI.h> #include <omniORB4/omniURI.h>
#include <omniORB4/Naming.hh>
#include <string.h> #include <string.h>
#include <sstream> #include <sstream>
#include "ObjectRepository.h" #include "ObjectRepository.h"
...@@ -125,7 +126,7 @@ void ObjectRepository::registration(const string& name, const ObjectPtr oRef, co ...@@ -125,7 +126,7 @@ void ObjectRepository::registration(const string& name, const ObjectPtr oRef, co
ctx->bind(oName, oRef); ctx->bind(oName, oRef);
return; return;
} }
catch(const CosNaming::NamingContext::AlreadyBound& nf) catch(const CosNaming::NamingContext::AlreadyBound&)
{ {
uwarn << "(registration): " << name << " уже зарегестрирован в " << section << "!!!" << endl; uwarn << "(registration): " << name << " уже зарегестрирован в " << section << "!!!" << endl;
...@@ -147,7 +148,7 @@ void ObjectRepository::registration(const string& name, const ObjectPtr oRef, co ...@@ -147,7 +148,7 @@ void ObjectRepository::registration(const string& name, const ObjectPtr oRef, co
{ {
throw NameNotFound(); throw NameNotFound();
} }
catch( const CosNaming::NamingContext::InvalidName& nf ) catch( const CosNaming::NamingContext::InvalidName& )
{ {
err << "ObjectRepository(registration): (InvalidName) не смог зарегистрировать ссылку " << name;; err << "ObjectRepository(registration): (InvalidName) не смог зарегистрировать ссылку " << name;;
} }
...@@ -212,11 +213,11 @@ void ObjectRepository::unregistration( const string& name, const string& section ...@@ -212,11 +213,11 @@ void ObjectRepository::unregistration( const string& name, const string& section
ctx->unbind(oName); ctx->unbind(oName);
return; return;
} }
catch(const CosNaming::NamingContext::NotFound& nf) catch(const CosNaming::NamingContext::NotFound&)
{ {
err << "ObjectRepository(unregistrartion): не найден объект ->" << name; err << "ObjectRepository(unregistrartion): не найден объект ->" << name;
} }
catch(const CosNaming::NamingContext::InvalidName& in) catch(const CosNaming::NamingContext::InvalidName&)
{ {
err << "ObjectRepository(unregistrartion): не корректное имя объекта -> " << name; err << "ObjectRepository(unregistrartion): не корректное имя объекта -> " << name;
} }
...@@ -264,11 +265,11 @@ ObjectPtr ObjectRepository::resolve( const string& name, const string& NSName ) ...@@ -264,11 +265,11 @@ ObjectPtr ObjectRepository::resolve( const string& name, const string& NSName )
err << "ObjectRepository(resolve): не смог получить ссылку на объект " << name.c_str(); err << "ObjectRepository(resolve): не смог получить ссылку на объект " << name.c_str();
} }
catch(const CosNaming::NamingContext::NotFound& nf) catch(const CosNaming::NamingContext::NotFound&)
{ {
err << "ObjectRepository(resolve): NameNotFound name= " << name; err << "ObjectRepository(resolve): NameNotFound name= " << name;
} }
catch(const CosNaming::NamingContext::InvalidName& nf) catch(const CosNaming::NamingContext::InvalidName&)
{ {
err << "ObjectRepository(resolve): не смог получить ссылку на контекст(InvalidName) "; err << "ObjectRepository(resolve): не смог получить ссылку на контекст(InvalidName) ";
} }
...@@ -511,10 +512,10 @@ bool ObjectRepository::createContext( const string& cname, CosNaming::NamingCont ...@@ -511,10 +512,10 @@ bool ObjectRepository::createContext( const string& cname, CosNaming::NamingCont
ulogrep << "ORepFactory(createContext): создал. " << endl; ulogrep << "ORepFactory(createContext): создал. " << endl;
return true; return true;
} }
catch(const CosNaming::NamingContext::AlreadyBound& ab) catch(const CosNaming::NamingContext::AlreadyBound ab)
{ {
// ctx->resolve(nc); // ctx->resolve(nc);
ulogrep << "ORepFactory(createContext): context " << cname << " уже есть" << endl; ulogrep << "ORepFactory(createContext): context " << cname << " already exist" << endl;
return true; return true;
} }
catch( const CosNaming::NamingContext::NotFound ) catch( const CosNaming::NamingContext::NotFound )
...@@ -522,7 +523,7 @@ bool ObjectRepository::createContext( const string& cname, CosNaming::NamingCont ...@@ -522,7 +523,7 @@ bool ObjectRepository::createContext( const string& cname, CosNaming::NamingCont
ulogrep << "ORepFactory(createContext): NotFound " << cname << endl; ulogrep << "ORepFactory(createContext): NotFound " << cname << endl;
throw NameNotFound(); throw NameNotFound();
} }
catch( const CosNaming::NamingContext::InvalidName& nf ) catch( const CosNaming::NamingContext::InvalidName& )
{ {
uwarn << "ORepFactory(createContext): (InvalidName) " << cname; uwarn << "ORepFactory(createContext): (InvalidName) " << cname;
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <thread> #include <thread>
#include <atomic> #include <atomic>
#include "Configuration.h" #include "Configuration.h"
#include "Exceptions.h"
#include "MQAtomic.h" #include "MQAtomic.h"
#include "MQMutex.h" #include "MQMutex.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
......
...@@ -172,7 +172,7 @@ TEST_CASE("UniXML::iterator::find1Level", "[unixml][find1levels]" ) ...@@ -172,7 +172,7 @@ TEST_CASE("UniXML::iterator::find1Level", "[unixml][find1levels]" )
xmlNode* onode = uxml.findNode(uxml.getFirstNode(), "onelevelfind"); xmlNode* onode = uxml.findNode(uxml.getFirstNode(), "onelevelfind");
REQUIRE( onode != NULL ); REQUIRE( onode != NULL );
UniXML::iterator oit(onode); UniXML::iterator oit(onode);
UniXML::iterator oit2 = uxml.findNodeLevel1(oit,"item","l2"); UniXML::iterator oit2 = uxml.findNodeLevel1(oit, "item", "l2");
REQUIRE(oit2); REQUIRE(oit2);
REQUIRE(oit2.getProp("prop") == "yes"); REQUIRE(oit2.getProp("prop") == "yes");
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <iostream> #include <iostream>
#include "Configuration.h" #include "Configuration.h"
#include "Exceptions.h"
int main( int argc, const char* argv[] ) int main( int argc, const char* argv[] )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment