Commit d9ec54e6 authored by Pavel Vainerman's avatar Pavel Vainerman

(2.0): - UniversalInterface --> UInterface - ObjectsManager --> UniSetManager -…

(2.0): - UniversalInterface --> UInterface - ObjectsManager --> UniSetManager - ObjectsActitvator --> UniSetActivator
parent dc1fabfe
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define BaseIOController_i_IDL_ #define BaseIOController_i_IDL_
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include "../UniSetTypes/UniSetTypes_i.idl" #include "../UniSetTypes/UniSetTypes_i.idl"
#include "../UniSetTypes/ObjectsManager_i.idl" #include "../UniSetTypes/UniSetManager_i.idl"
// -------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------
/*! /*!
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
* \brief Базовый интерфейс для создания координаторов ввода/вывода * \brief Базовый интерфейс для создания координаторов ввода/вывода
* *
*/ */
interface IOController_i : ObjectsManager_i interface IOController_i : UniSetManager_i
{ {
// исключения // исключения
......
...@@ -7,7 +7,7 @@ CCDIR=$(top_builddir)/src/ObjectRepository ...@@ -7,7 +7,7 @@ CCDIR=$(top_builddir)/src/ObjectRepository
HHDIR=$(top_builddir)/include HHDIR=$(top_builddir)/include
# Исходные файлы IDL # Исходные файлы IDL
IDLFILES=UniSetTypes_i.idl UniSetObject_i.idl ObjectsManager_i.idl IDLFILES=UniSetTypes_i.idl UniSetObject_i.idl UniSetManager_i.idl
include $(top_builddir)/conf/idl.mk include $(top_builddir)/conf/idl.mk
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
/*! \file /*! \file
* \author Pavel Vainerman * \author Pavel Vainerman
* \date $Date: 2007/12/18 20:24:11 $ * \date $Date: 2007/12/18 20:24:11 $
* \version $Id: ObjectsManager_i.idl,v 1.2 2007/12/18 20:24:11 vpashka Exp $ * \version $Id: UniSetManager_i.idl,v 1.2 2007/12/18 20:24:11 vpashka Exp $
*/ */
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#ifndef ObjectsManager_i_IDL_ #ifndef UniSetManager_i_IDL_
#define ObjectsManager_i_IDL_ #define UniSetManager_i_IDL_
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
#include "UniSetObject_i.idl" #include "UniSetObject_i.idl"
#include "UniSetTypes_i.idl" #include "UniSetTypes_i.idl"
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
//{ //{
/*! /*!
* \interface ObjectsManager_i * \interface UniSetManager_i
* \brief Интерфейс менеджера объектов * \brief Интерфейс менеджера объектов
* \author Pavel Vainerman * \author Pavel Vainerman
* \version * \version
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
* Базовый класс для менеджеров объектов. Позволяет посылать сообщение * Базовый класс для менеджеров объектов. Позволяет посылать сообщение
* ко всем объектам сразу. * ко всем объектам сразу.
*/ */
interface ObjectsManager_i : UniSetObject_i interface UniSetManager_i : UniSetObject_i
{ {
/*!< распространить сообщение всем подчиненным объектам */ /*!< распространить сообщение всем подчиненным объектам */
void broadcast(in UniSetTypes::TransportMessage msg); void broadcast(in UniSetTypes::TransportMessage msg);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "Exceptions.h" #include "Exceptions.h"
#include "UniSetObject.h" #include "UniSetObject.h"
#include "UniSetTypes.h" #include "UniSetTypes.h"
#include "ObjectsManager.h" #include "UniSetManager.h"
#include "MessageType.h" #include "MessageType.h"
#include "Configuration.h" #include "Configuration.h"
#include "ObjectIndex_XML.h" #include "ObjectIndex_XML.h"
...@@ -58,14 +58,14 @@ static bool commandToAll( const string& section, ObjectRepository *rep, Command ...@@ -58,14 +58,14 @@ static bool commandToAll( const string& section, ObjectRepository *rep, Command
static void createSections( UniSetTypes::Configuration* c ); static void createSections( UniSetTypes::Configuration* c );
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
int omap(); int omap();
int configure( const string& args, UniversalInterface &ui ); int configure( const string& args, UInterface &ui );
int logRotate( const string& args, UniversalInterface &ui ); int logRotate( const string& args, UInterface &ui );
int setValue( const string& args, UniversalInterface &ui, Configuration* conf = UniSetTypes::conf ); int setValue( const string& args, UInterface &ui, Configuration* conf = UniSetTypes::conf );
int getValue( const string& args, UniversalInterface &ui, Configuration* conf = UniSetTypes::conf ); int getValue( const string& args, UInterface &ui, Configuration* conf = UniSetTypes::conf );
int getRawValue( const string& args, UniversalInterface &ui ); int getRawValue( const string& args, UInterface &ui );
int getState( const string& args, UniversalInterface &ui ); int getState( const string& args, UInterface &ui );
int getCalibrate( const string& args, UniversalInterface &ui ); int getCalibrate( const string& args, UInterface &ui );
int oinfo( const string& args, UniversalInterface &ui ); int oinfo( const string& args, UInterface &ui );
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
static void print_help(int width, const string& cmd, const string& help, const string& tab=" " ) static void print_help(int width, const string& cmd, const string& help, const string& tab=" " )
{ {
...@@ -154,7 +154,7 @@ int main(int argc, char** argv) ...@@ -154,7 +154,7 @@ int main(int argc, char** argv)
case 'x': //--setValue case 'x': //--setValue
{ {
uniset_init(argc,argv,conffile); uniset_init(argc,argv,conffile);
UniversalInterface ui(conf); UInterface ui(conf);
return setValue(optarg,ui); return setValue(optarg,ui);
} }
break; break;
...@@ -163,7 +163,7 @@ int main(int argc, char** argv) ...@@ -163,7 +163,7 @@ int main(int argc, char** argv)
{ {
// cout<<"(main):received option --getValue='"<<optarg<<"'"<<endl; // cout<<"(main):received option --getValue='"<<optarg<<"'"<<endl;
uniset_init(argc,argv,conffile); uniset_init(argc,argv,conffile);
UniversalInterface ui(conf); UInterface ui(conf);
return getValue(optarg,ui); return getValue(optarg,ui);
} }
break; break;
...@@ -172,7 +172,7 @@ int main(int argc, char** argv) ...@@ -172,7 +172,7 @@ int main(int argc, char** argv)
{ {
// cout<<"(main):received option --getRawValue='"<<optarg<<"'"<<endl; // cout<<"(main):received option --getRawValue='"<<optarg<<"'"<<endl;
uniset_init(argc,argv,conffile); uniset_init(argc,argv,conffile);
UniversalInterface ui(conf); UInterface ui(conf);
return getRawValue(optarg,ui); return getRawValue(optarg,ui);
} }
break; break;
...@@ -181,7 +181,7 @@ int main(int argc, char** argv) ...@@ -181,7 +181,7 @@ int main(int argc, char** argv)
{ {
// cout<<"(main):received option --oinfo='"<<optarg<<"'"<<endl; // cout<<"(main):received option --oinfo='"<<optarg<<"'"<<endl;
uniset_init(argc,argv,conffile); uniset_init(argc,argv,conffile);
UniversalInterface ui(conf); UInterface ui(conf);
return oinfo(optarg,ui); return oinfo(optarg,ui);
} }
break; break;
...@@ -190,7 +190,7 @@ int main(int argc, char** argv) ...@@ -190,7 +190,7 @@ int main(int argc, char** argv)
{ {
// cout<<"(main):received option --exist"<<endl; // cout<<"(main):received option --exist"<<endl;
uniset_init(argc,argv,conffile); uniset_init(argc,argv,conffile);
UniversalInterface ui(conf); UInterface ui(conf);
Command cmd=Exist; Command cmd=Exist;
ObjectRepository* rep = new ObjectRepository(conf); ObjectRepository* rep = new ObjectRepository(conf);
...@@ -206,7 +206,7 @@ int main(int argc, char** argv) ...@@ -206,7 +206,7 @@ int main(int argc, char** argv)
{ {
// cout<<"(main):received option --start"<<endl; // cout<<"(main):received option --start"<<endl;
uniset_init(argc,argv,conffile); uniset_init(argc,argv,conffile);
UniversalInterface ui(conf); UInterface ui(conf);
Command cmd=StartUp; Command cmd=StartUp;
ObjectRepository* rep = new ObjectRepository(conf); ObjectRepository* rep = new ObjectRepository(conf);
...@@ -220,7 +220,7 @@ int main(int argc, char** argv) ...@@ -220,7 +220,7 @@ int main(int argc, char** argv)
case 'r': //--configure case 'r': //--configure
{ {
uniset_init(argc,argv,conffile); uniset_init(argc,argv,conffile);
UniversalInterface ui(conf); UInterface ui(conf);
return configure(optarg,ui); return configure(optarg,ui);
} }
break; break;
...@@ -229,7 +229,7 @@ int main(int argc, char** argv) ...@@ -229,7 +229,7 @@ int main(int argc, char** argv)
{ {
// cout<<"(main):received option --finish"<<endl; // cout<<"(main):received option --finish"<<endl;
uniset_init(argc,argv,conffile); uniset_init(argc,argv,conffile);
UniversalInterface ui(conf); UInterface ui(conf);
Command cmd=Finish; Command cmd=Finish;
ObjectRepository* rep = new ObjectRepository(conf); ObjectRepository* rep = new ObjectRepository(conf);
...@@ -244,7 +244,7 @@ int main(int argc, char** argv) ...@@ -244,7 +244,7 @@ int main(int argc, char** argv)
case 'l': //--logrotate case 'l': //--logrotate
{ {
uniset_init(argc,argv,conffile); uniset_init(argc,argv,conffile);
UniversalInterface ui(conf); UInterface ui(conf);
return logRotate(optarg, ui); return logRotate(optarg, ui);
} }
break; break;
...@@ -253,7 +253,7 @@ int main(int argc, char** argv) ...@@ -253,7 +253,7 @@ int main(int argc, char** argv)
{ {
// cout<<"(main):received option --getCalibrate='"<<optarg<<"'"<<endl; // cout<<"(main):received option --getCalibrate='"<<optarg<<"'"<<endl;
uniset_init(argc,argv,conffile); uniset_init(argc,argv,conffile);
UniversalInterface ui(conf); UInterface ui(conf);
return getCalibrate(optarg, ui); return getCalibrate(optarg, ui);
} }
break; break;
...@@ -262,7 +262,7 @@ int main(int argc, char** argv) ...@@ -262,7 +262,7 @@ int main(int argc, char** argv)
{ {
// cout<<"(main):received option --foldUp"<<endl; // cout<<"(main):received option --foldUp"<<endl;
uniset_init(argc,argv,conffile); uniset_init(argc,argv,conffile);
UniversalInterface ui(conf); UInterface ui(conf);
Command cmd=FoldUp; Command cmd=FoldUp;
ObjectRepository* rep = new ObjectRepository(conf); ObjectRepository* rep = new ObjectRepository(conf);
...@@ -327,7 +327,7 @@ static bool commandToAll(const string& section, ObjectRepository *rep, Command c ...@@ -327,7 +327,7 @@ static bool commandToAll(const string& section, ObjectRepository *rep, Command c
return false; return false;
} }
ObjectsManager_i_var proc; UniSetManager_i_var proc;
UniSetObject_i_var obj; UniSetObject_i_var obj;
string fullName; string fullName;
ListObjectName::const_iterator li; ListObjectName::const_iterator li;
...@@ -455,7 +455,7 @@ int omap() ...@@ -455,7 +455,7 @@ int omap()
} }
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
int setValue( const string& args, UniversalInterface &ui, Configuration* conf ) int setValue( const string& args, UInterface &ui, Configuration* conf )
{ {
int err = 0; int err = 0;
...@@ -501,7 +501,7 @@ int setValue( const string& args, UniversalInterface &ui, Configuration* conf ) ...@@ -501,7 +501,7 @@ int setValue( const string& args, UniversalInterface &ui, Configuration* conf )
} }
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
int getValue( const string& args, UniversalInterface &ui, Configuration* conf ) int getValue( const string& args, UInterface &ui, Configuration* conf )
{ {
int err = 0; int err = 0;
...@@ -545,7 +545,7 @@ int getValue( const string& args, UniversalInterface &ui, Configuration* conf ) ...@@ -545,7 +545,7 @@ int getValue( const string& args, UniversalInterface &ui, Configuration* conf )
return err; return err;
} }
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
int getCalibrate( const std::string& args, UniversalInterface &ui ) int getCalibrate( const std::string& args, UInterface &ui )
{ {
int err = 0; int err = 0;
typedef std::list<UniSetTypes::ParamSInfo> SList; typedef std::list<UniSetTypes::ParamSInfo> SList;
...@@ -575,7 +575,7 @@ int getCalibrate( const std::string& args, UniversalInterface &ui ) ...@@ -575,7 +575,7 @@ int getCalibrate( const std::string& args, UniversalInterface &ui )
} }
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
int getRawValue( const std::string& args, UniversalInterface &ui ) int getRawValue( const std::string& args, UInterface &ui )
{ {
int err = 0; int err = 0;
typedef std::list<UniSetTypes::ParamSInfo> SList; typedef std::list<UniSetTypes::ParamSInfo> SList;
...@@ -602,7 +602,7 @@ int getRawValue( const std::string& args, UniversalInterface &ui ) ...@@ -602,7 +602,7 @@ int getRawValue( const std::string& args, UniversalInterface &ui )
} }
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
int logRotate( const string& arg, UniversalInterface &ui ) int logRotate( const string& arg, UInterface &ui )
{ {
// посылка всем // посылка всем
if( arg.empty() || (arg.c_str())[0]!='-' ) if( arg.empty() || (arg.c_str())[0]!='-' )
...@@ -631,7 +631,7 @@ int logRotate( const string& arg, UniversalInterface &ui ) ...@@ -631,7 +631,7 @@ int logRotate( const string& arg, UniversalInterface &ui )
} }
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
int configure( const string& arg, UniversalInterface &ui ) int configure( const string& arg, UInterface &ui )
{ {
// посылка всем // посылка всем
if( arg.empty() || (arg.c_str())[0]!='-' ) if( arg.empty() || (arg.c_str())[0]!='-' )
...@@ -659,7 +659,7 @@ int configure( const string& arg, UniversalInterface &ui ) ...@@ -659,7 +659,7 @@ int configure( const string& arg, UniversalInterface &ui )
} }
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
int oinfo( const string& arg, UniversalInterface &ui ) int oinfo( const string& arg, UInterface &ui )
{ {
UniSetTypes::ObjectId oid(uni_atoi(arg)); UniSetTypes::ObjectId oid(uni_atoi(arg));
if( oid==0 ) if( oid==0 )
......
#include "Configuration.h" #include "Configuration.h"
#include "NullController.h" #include "NullController.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Debug.h" #include "Debug.h"
#include "PassiveTimer.h" #include "PassiveTimer.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
...@@ -71,7 +71,7 @@ int main(int argc, char** argv) ...@@ -71,7 +71,7 @@ int main(int argc, char** argv)
bool dbDumping = conf->getArgInt("--dbDumping"); bool dbDumping = conf->getArgInt("--dbDumping");
NullController nc(ID,askfile,s_field,s_fvalue,c_field,c_fvalue,dbDumping); NullController nc(ID,askfile,s_field,s_fvalue,c_field,c_fvalue,dbDumping);
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(&nc)); act.addObject(static_cast<class UniSetObject*>(&nc));
act.run(false); act.run(false);
return 0; return 0;
......
#include <iostream> #include <iostream>
#include "Exceptions.h" #include "Exceptions.h"
#include "UniversalInterface.h" #include "UInterface.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
using namespace std; using namespace std;
using namespace UniSetTypes; using namespace UniSetTypes;
...@@ -37,7 +37,7 @@ int main( int argc, char **argv ) ...@@ -37,7 +37,7 @@ int main( int argc, char **argv )
// ------------------------------------- // -------------------------------------
uniset_init(argc, argv, "configure.xml" ); uniset_init(argc, argv, "configure.xml" );
UniversalInterface ui; UInterface ui;
string sid(conf->getArgParam("--sid")); string sid(conf->getArgParam("--sid"));
if( sid.empty() ) if( sid.empty() )
......
#include <iostream> #include <iostream>
#include <string> #include <string>
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Configuration.h" #include "Configuration.h"
#include "SMonitor.h" #include "SMonitor.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -33,7 +33,7 @@ int main( int argc, const char **argv ) ...@@ -33,7 +33,7 @@ int main( int argc, const char **argv )
return 0; return 0;
} }
ObjectsActivator act; UniSetActivator act;
SMonitor tp(ID); SMonitor tp(ID);
act.addObject(&tp); act.addObject(&tp);
......
...@@ -23,7 +23,7 @@ int main(int argc, const char **argv) ...@@ -23,7 +23,7 @@ int main(int argc, const char **argv)
uniset_init(argc,argv,"configure.xml"); uniset_init(argc,argv,"configure.xml");
/* /*
UniversalInterface ui; UInterface ui;
IDList lst; IDList lst;
lst.add(1); lst.add(1);
lst.add(2); lst.add(2);
......
#include <sstream> #include <sstream>
#include <ObjectsActivator.h> #include <UniSetActivator.h>
#include "Skel.h" #include "Skel.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
using namespace UniSetTypes; using namespace UniSetTypes;
...@@ -17,7 +17,7 @@ int main( int argc, const char **argv ) ...@@ -17,7 +17,7 @@ int main( int argc, const char **argv )
ulog.logFile( logname.c_str() ); ulog.logFile( logname.c_str() );
// conf->initDebug(dlog,"dlog"); // conf->initDebug(dlog,"dlog");
ObjectsActivator act; UniSetActivator act;
xmlNode* cnode = conf->getNode("Skel"); xmlNode* cnode = conf->getNode("Skel");
if( cnode == NULL ) if( cnode == NULL )
{ {
......
...@@ -355,6 +355,10 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname ...@@ -355,6 +355,10 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
- remove deprecated interfaces (Storages,CycleStorage,TableStorage,TextIndex,..) - remove deprecated interfaces (Storages,CycleStorage,TableStorage,TextIndex,..)
- rename unideb --> ulog - rename unideb --> ulog
- DebugStream refactoring (add new function) - DebugStream refactoring (add new function)
- UniversalInterface --> UInterface
- ObjectsManager --> UniSetManager
- ObjectsActitvator --> UniSetActivator
* Tue Dec 10 2013 Pavel Vainerman <pv@altlinux.ru> 1.7-alt3 * Tue Dec 10 2013 Pavel Vainerman <pv@altlinux.ru> 1.7-alt3
- add RRDServer - add RRDServer
......
#include "Configuration.h" #include "Configuration.h"
#include "DBServer_MySQL.h" #include "DBServer_MySQL.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Debug.h" #include "Debug.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
using namespace UniSetTypes; using namespace UniSetTypes;
...@@ -52,7 +52,7 @@ int main(int argc, char** argv) ...@@ -52,7 +52,7 @@ int main(int argc, char** argv)
} }
DBServer_MySQL dbs(ID); DBServer_MySQL dbs(ID);
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(&dbs)); act.addObject(static_cast<class UniSetObject*>(&dbs));
act.run(false); act.run(false);
} }
......
#include "Configuration.h" #include "Configuration.h"
#include "DBServer_SQLite.h" #include "DBServer_SQLite.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Debug.h" #include "Debug.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
using namespace UniSetTypes; using namespace UniSetTypes;
...@@ -52,7 +52,7 @@ int main(int argc, char** argv) ...@@ -52,7 +52,7 @@ int main(int argc, char** argv)
} }
DBServer_SQLite dbs(ID); DBServer_SQLite dbs(ID);
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(&dbs)); act.addObject(static_cast<class UniSetObject*>(&dbs));
act.run(false); act.run(false);
} }
......
...@@ -330,7 +330,7 @@ class IOControl: ...@@ -330,7 +330,7 @@ class IOControl:
std::string s_fvalue; std::string s_fvalue;
SMInterface* shm; SMInterface* shm;
UniversalInterface ui; UInterface ui;
UniSetTypes::ObjectId myid; UniSetTypes::ObjectId myid;
std::string prefix; std::string prefix;
......
#include <string> #include <string>
#include "Debug.h" #include "Debug.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Configuration.h" #include "Configuration.h"
#include "IOControl.h" #include "IOControl.h"
#include "Extensions.h" #include "Extensions.h"
...@@ -52,7 +52,7 @@ int main(int argc, const char **argv) ...@@ -52,7 +52,7 @@ int main(int argc, const char **argv)
return 1; return 1;
} }
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(ic)); act.addObject(static_cast<class UniSetObject*>(ic));
SystemMessage sm(SystemMessage::StartUp); SystemMessage sm(SystemMessage::StartUp);
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include <map> #include <map>
#include "UniSetTypes.h" #include "UniSetTypes.h"
#include "UniversalInterface.h" #include "UInterface.h"
#include "Element.h" #include "Element.h"
#include "Schema.h" #include "Schema.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
...@@ -131,7 +131,7 @@ class LProcessor ...@@ -131,7 +131,7 @@ class LProcessor
OUTList extOuts; OUTList extOuts;
SchemaXML sch; SchemaXML sch;
UniversalInterface ui; UInterface ui;
int sleepTime; int sleepTime;
int smReadyTimeout; /*!< время ожидания готовности SM */ int smReadyTimeout; /*!< время ожидания готовности SM */
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "UniSetObject_LT.h" #include "UniSetObject_LT.h"
#include "Extensions.h" #include "Extensions.h"
#include "SharedMemory.h" #include "SharedMemory.h"
#include "UniversalInterface.h" #include "UInterface.h"
#include "SMInterface.h" #include "SMInterface.h"
#include "LProcessor.h" #include "LProcessor.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
......
#include <iostream> #include <iostream>
#include "Configuration.h" #include "Configuration.h"
#include "Extensions.h" #include "Extensions.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "PassiveLProcessor.h" #include "PassiveLProcessor.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -70,7 +70,7 @@ int main(int argc, const char **argv) ...@@ -70,7 +70,7 @@ int main(int argc, const char **argv)
PassiveLProcessor plc(schema,ID,shmID); PassiveLProcessor plc(schema,ID,shmID);
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(&plc)); act.addObject(static_cast<class UniSetObject*>(&plc));
SystemMessage sm(SystemMessage::StartUp); SystemMessage sm(SystemMessage::StartUp);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "MBTCPMaster.h" #include "MBTCPMaster.h"
#include "Configuration.h" #include "Configuration.h"
#include "Debug.h" #include "Debug.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Extensions.h" #include "Extensions.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
using namespace std; using namespace std;
...@@ -59,7 +59,7 @@ int main( int argc, const char** argv ) ...@@ -59,7 +59,7 @@ int main( int argc, const char** argv )
return 1; return 1;
} }
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(mb)); act.addObject(static_cast<class UniSetObject*>(mb));
SystemMessage sm(SystemMessage::StartUp); SystemMessage sm(SystemMessage::StartUp);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "MBTCPMultiMaster.h" #include "MBTCPMultiMaster.h"
#include "Configuration.h" #include "Configuration.h"
#include "Debug.h" #include "Debug.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Extensions.h" #include "Extensions.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
using namespace std; using namespace std;
...@@ -59,7 +59,7 @@ int main( int argc, const char** argv ) ...@@ -59,7 +59,7 @@ int main( int argc, const char** argv )
return 1; return 1;
} }
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(mb)); act.addObject(static_cast<class UniSetObject*>(mb));
SystemMessage sm(SystemMessage::StartUp); SystemMessage sm(SystemMessage::StartUp);
......
#include <sys/wait.h> #include <sys/wait.h>
#include <sstream> #include <sstream>
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Extensions.h" #include "Extensions.h"
#include "RTUExchange.h" #include "RTUExchange.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -57,7 +57,7 @@ int main( int argc, char** argv ) ...@@ -57,7 +57,7 @@ int main( int argc, char** argv )
return 1; return 1;
} }
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(rs)); act.addObject(static_cast<class UniSetObject*>(rs));
SystemMessage sm(SystemMessage::StartUp); SystemMessage sm(SystemMessage::StartUp);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "MBSlave.h" #include "MBSlave.h"
#include "Configuration.h" #include "Configuration.h"
#include "Debug.h" #include "Debug.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Extensions.h" #include "Extensions.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
...@@ -64,7 +64,7 @@ int main(int argc, const char **argv) ...@@ -64,7 +64,7 @@ int main(int argc, const char **argv)
return 1; return 1;
} }
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(s)); act.addObject(static_cast<class UniSetObject*>(s));
SystemMessage sm(SystemMessage::StartUp); SystemMessage sm(SystemMessage::StartUp);
act.broadcast( sm.transport_msg() ); act.broadcast( sm.transport_msg() );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "RRDServer.h" #include "RRDServer.h"
#include "Configuration.h" #include "Configuration.h"
#include "Debug.h" #include "Debug.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Extensions.h" #include "Extensions.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
using namespace std; using namespace std;
...@@ -58,7 +58,7 @@ int main( int argc, const char** argv ) ...@@ -58,7 +58,7 @@ int main( int argc, const char** argv )
return 1; return 1;
} }
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(db)); act.addObject(static_cast<class UniSetObject*>(db));
SystemMessage sm(SystemMessage::StartUp); SystemMessage sm(SystemMessage::StartUp);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "SMDBServer.h" #include "SMDBServer.h"
#include "Configuration.h" #include "Configuration.h"
#include "Debug.h" #include "Debug.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Extensions.h" #include "Extensions.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
using namespace std; using namespace std;
...@@ -58,7 +58,7 @@ int main( int argc, const char** argv ) ...@@ -58,7 +58,7 @@ int main( int argc, const char** argv )
return 1; return 1;
} }
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(db)); act.addObject(static_cast<class UniSetObject*>(db));
SystemMessage sm(SystemMessage::StartUp); SystemMessage sm(SystemMessage::StartUp);
......
...@@ -19,7 +19,7 @@ class SMViewer: ...@@ -19,7 +19,7 @@ class SMViewer:
private: private:
SMInterface* shm; SMInterface* shm;
UniversalInterface ui; UInterface ui;
}; };
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#endif #endif
......
#include <string> #include <string>
#include "Debug.h" #include "Debug.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "SharedMemory.h" #include "SharedMemory.h"
#include "Extensions.h" #include "Extensions.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
...@@ -32,7 +32,7 @@ int main(int argc, const char **argv) ...@@ -32,7 +32,7 @@ int main(int argc, const char **argv)
if( !shm ) if( !shm )
return 1; return 1;
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(shm)); act.addObject(static_cast<class UniSetObject*>(shm));
SystemMessage sm(SystemMessage::StartUp); SystemMessage sm(SystemMessage::StartUp);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <error.h> #include <error.h>
#include <errno.h> #include <errno.h>
#include <Debug.h> #include <Debug.h>
#include <ObjectsActivator.h> #include <UniSetActivator.h>
#include <ThreadCreator.h> #include <ThreadCreator.h>
#include "Extensions.h" #include "Extensions.h"
#include "RTUExchange.h" #include "RTUExchange.h"
...@@ -55,13 +55,13 @@ int main( int argc, const char **argv ) ...@@ -55,13 +55,13 @@ int main( int argc, const char **argv )
ulog.logFile( logname ); ulog.logFile( logname );
conf->initDebug(UniSetExtensions::dlog,"dlog"); conf->initDebug(UniSetExtensions::dlog,"dlog");
ObjectsActivator act; UniSetActivator act;
// ------------ SharedMemory ---------------- // ------------ SharedMemory ----------------
SharedMemory* shm = SharedMemory::init_smemory(argc,argv); SharedMemory* shm = SharedMemory::init_smemory(argc,argv);
if( shm == NULL ) if( shm == NULL )
return 1; return 1;
act.addManager(static_cast<class ObjectsManager*>(shm)); act.addManager(static_cast<class UniSetManager*>(shm));
// ------------ IOControl ---------------- // ------------ IOControl ----------------
std::list< ThreadCreator<IOControl>* > lst_iothr; std::list< ThreadCreator<IOControl>* > lst_iothr;
......
#include <sstream> #include <sstream>
#include <sys/wait.h> #include <sys/wait.h>
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Extensions.h" #include "Extensions.h"
#include "UNetExchange.h" #include "UNetExchange.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -56,7 +56,7 @@ int main( int argc, const char** argv ) ...@@ -56,7 +56,7 @@ int main( int argc, const char** argv )
return 1; return 1;
} }
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(unet)); act.addObject(static_cast<class UniSetObject*>(unet));
SystemMessage sm(SystemMessage::StartUp); SystemMessage sm(SystemMessage::StartUp);
......
#include <sys/wait.h> #include <sys/wait.h>
#include <string> #include <string>
#include "Debug.h" #include "Debug.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "UniExchange.h" #include "UniExchange.h"
#include "Extensions.h" #include "Extensions.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
...@@ -46,7 +46,7 @@ int main(int argc, const char **argv) ...@@ -46,7 +46,7 @@ int main(int argc, const char **argv)
if( !shm ) if( !shm )
return 1; return 1;
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(shm)); act.addObject(static_cast<class UniSetObject*>(shm));
SystemMessage sm(SystemMessage::StartUp); SystemMessage sm(SystemMessage::StartUp);
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
#include <string> #include <string>
#include "UniSetTypes.h" #include "UniSetTypes.h"
#include "IONotifyController.h" #include "IONotifyController.h"
#include "UniversalInterface.h" #include "UInterface.h"
class SMInterface class SMInterface
{ {
public: public:
SMInterface( UniSetTypes::ObjectId _shmID, UniversalInterface* ui, SMInterface( UniSetTypes::ObjectId _shmID, UInterface* ui,
UniSetTypes::ObjectId myid, IONotifyController* ic=0 ); UniSetTypes::ObjectId myid, IONotifyController* ic=0 );
~SMInterface(); ~SMInterface();
...@@ -55,7 +55,7 @@ class SMInterface ...@@ -55,7 +55,7 @@ class SMInterface
protected: protected:
IONotifyController* ic; IONotifyController* ic;
UniversalInterface* ui; UInterface* ui;
CORBA::Object_var oref; CORBA::Object_var oref;
UniSetTypes::ObjectId shmID; UniSetTypes::ObjectId shmID;
UniSetTypes::ObjectId myid; UniSetTypes::ObjectId myid;
......
...@@ -82,7 +82,7 @@ using namespace UniSetTypes; ...@@ -82,7 +82,7 @@ using namespace UniSetTypes;
} \ } \
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
SMInterface::SMInterface( UniSetTypes::ObjectId _shmID, UniversalInterface* _ui, SMInterface::SMInterface( UniSetTypes::ObjectId _shmID, UInterface* _ui,
UniSetTypes::ObjectId _myid, IONotifyController* ic ): UniSetTypes::ObjectId _myid, IONotifyController* ic ):
ic(ic), ic(ic),
ui(_ui), ui(_ui),
......
...@@ -39,7 +39,7 @@ void TestProc::sysCommand( UniSetTypes::SystemMessage* sm ) ...@@ -39,7 +39,7 @@ void TestProc::sysCommand( UniSetTypes::SystemMessage* sm )
void TestProc::sensorInfo( SensorMessage *sm ) void TestProc::sensorInfo( SensorMessage *sm )
{ {
dlog[Debug::LEVEL1] << myname << "(sensorInfo): id=" << sm->id << " val=" << sm->value dlog[Debug::LEVEL1] << myname << "(sensorInfo): id=" << sm->id << " val=" << sm->value
<< " " << UniversalInterface::timeToString(sm->sm_tv_sec,":") << " " << UInterface::timeToString(sm->sm_tv_sec,":")
<< "(" << setw(6) << sm->sm_tv_usec << "): " << "(" << setw(6) << sm->sm_tv_usec << "): "
<< endl; << endl;
......
#include <string> #include <string>
#include "Debug.h" #include "Debug.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "SharedMemory.h" #include "SharedMemory.h"
#include "Extensions.h" #include "Extensions.h"
#include "TestProc.h" #include "TestProc.h"
...@@ -36,7 +36,7 @@ int main(int argc, const char **argv) ...@@ -36,7 +36,7 @@ int main(int argc, const char **argv)
TestProc tp(conf->getObjectID("TestProc1")); TestProc tp(conf->getObjectID("TestProc1"));
tp.init_dlog(dlog); tp.init_dlog(dlog);
ObjectsActivator act; UniSetActivator act;
act.addObject(static_cast<class UniSetObject*>(shm)); act.addObject(static_cast<class UniSetObject*>(shm));
act.addObject(static_cast<class UniSetObject*>(&tp)); act.addObject(static_cast<class UniSetObject*>(&tp));
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
\subsection subDBS_idea Сценарий работы \subsection subDBS_idea Сценарий работы
На узле, где ведётся БД запускается один экземпляр сервиса. Клиенты могут получить доступ, несколькими способами: На узле, где ведётся БД запускается один экземпляр сервиса. Клиенты могут получить доступ, несколькими способами:
- через NameService - через NameService
- при помощи UniversalInterface::send() - при помощи UInterface::send()
Сервис является системным, поэтому его идентификатор можно получить при помощи Сервис является системным, поэтому его идентификатор можно получить при помощи
UniSetTypes::Configuration::getDBServer() объекта UniSetTypes::conf. UniSetTypes::Configuration::getDBServer() объекта UniSetTypes::conf.
......
...@@ -30,13 +30,13 @@ ...@@ -30,13 +30,13 @@
#include <sigc++/sigc++.h> #include <sigc++/sigc++.h>
#include "IOController_i.hh" #include "IOController_i.hh"
#include "UniSetTypes.h" #include "UniSetTypes.h"
#include "ObjectsManager.h" #include "UniSetManager.h"
#include "Configuration.h" #include "Configuration.h"
#include "Mutex.h" #include "Mutex.h"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
/*! Реализация интерфейса IOController-а */ /*! Реализация интерфейса IOController-а */
class IOController: class IOController:
public ObjectsManager, public UniSetManager,
public POA_IOController_i public POA_IOController_i
{ {
public: public:
......
...@@ -45,7 +45,7 @@ class ProxyManager: ...@@ -45,7 +45,7 @@ class ProxyManager:
void attachObject( PassiveObject* po, UniSetTypes::ObjectId id ); void attachObject( PassiveObject* po, UniSetTypes::ObjectId id );
void detachObject( UniSetTypes::ObjectId id ); void detachObject( UniSetTypes::ObjectId id );
UniversalInterface* uin; UInterface* uin;
protected: protected:
ProxyManager(); ProxyManager();
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <string> #include <string>
#include "IOController_i.hh" #include "IOController_i.hh"
#include "ObjectRepository.h" #include "ObjectRepository.h"
#include "UniversalInterface.h" #include "UInterface.h"
#include "PassiveTimer.h" #include "PassiveTimer.h"
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
class SViewer class SViewer
...@@ -57,8 +57,8 @@ class SViewer ...@@ -57,8 +57,8 @@ class SViewer
private: private:
ObjectRepository rep; ObjectRepository rep;
UniversalInterface::CacheOfResolve cache; UInterface::CacheOfResolve cache;
UniversalInterface ui; UInterface ui;
bool isShort; bool isShort;
}; };
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
* \author Pavel Vainerman * \author Pavel Vainerman
*/ */
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#ifndef UniversalInterface_H_ #ifndef UInterface_H_
#define UniversalInterface_H_ #define UInterface_H_
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
#include <string> #include <string>
#include <sstream> #include <sstream>
...@@ -52,19 +52,19 @@ namespace UniversalIO ...@@ -52,19 +52,19 @@ namespace UniversalIO
#define IO_THROW_EXCEPTIONS UniSetTypes::TimeOut,UniSetTypes::IOBadParam,UniSetTypes::ORepFailed #define IO_THROW_EXCEPTIONS UniSetTypes::TimeOut,UniSetTypes::IOBadParam,UniSetTypes::ORepFailed
// ----------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------
/*! /*!
* \class UniversalInterface * \class UInterface
* ... а здесь идет кратенькое описание... (коротенько минут на 40!...) * ... а здесь идет кратенькое описание... (коротенько минут на 40!...)
* Для увеличения производительности в функции встроен cache обращений... * Для увеличения производительности в функции встроен cache обращений...
* *
* См. также \ref UniversalIOControllerPage * См. также \ref UniversalIOControllerPage
*/ */
class UniversalInterface class UInterface
{ {
public: public:
UniversalInterface( UniSetTypes::ObjectId backid, CORBA::ORB_var orb=NULL, UniSetTypes::ObjectIndex* oind=NULL ); UInterface( UniSetTypes::ObjectId backid, CORBA::ORB_var orb=NULL, UniSetTypes::ObjectIndex* oind=NULL );
UniversalInterface( UniSetTypes::Configuration* uconf=UniSetTypes::conf ); UInterface( UniSetTypes::Configuration* uconf=UniSetTypes::conf );
~UniversalInterface(); ~UInterface();
inline UniSetTypes::ObjectIndex* getObjectIndex() { return oind; } inline UniSetTypes::ObjectIndex* getObjectIndex() { return oind; }
inline UniSetTypes::Configuration* getConf() { return uconf; } inline UniSetTypes::Configuration* getConf() { return uconf; }
......
...@@ -22,17 +22,17 @@ ...@@ -22,17 +22,17 @@
* \author Pavel Vainerman * \author Pavel Vainerman
*/ */
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#ifndef ObjectsActivator_H_ #ifndef UniSetActivator_H_
#define ObjectsActivator_H_ #define UniSetActivator_H_
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include <omniORB4/CORBA.h> #include <omniORB4/CORBA.h>
#include "UniSetTypes.h" #include "UniSetTypes.h"
#include "UniSetObject.h" #include "UniSetObject.h"
#include "ObjectsManager.h" #include "UniSetManager.h"
#include "ThreadCreator.h" #include "ThreadCreator.h"
//#include "OmniThreadCreator.h" //#include "OmniThreadCreator.h"
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
/*! \class ObjectsActivator /*! \class UniSetActivator
* Создает POA менеджер и регистрирует в нем объекты. * Создает POA менеджер и регистрирует в нем объекты.
* Для обработки CORBA-запросов создается поток или передаются ресурсы * Для обработки CORBA-запросов создается поток или передаются ресурсы
* главного потока см. void activate(bool thread) * главного потока см. void activate(bool thread)
...@@ -41,14 +41,14 @@ ...@@ -41,14 +41,14 @@
* *
* \todo Разобраться со всякими oaDestroy, stop, oakill и сделать одну надежную завершающую функцию. * \todo Разобраться со всякими oaDestroy, stop, oakill и сделать одну надежную завершающую функцию.
*/ */
class ObjectsActivator: class UniSetActivator:
public ObjectsManager public UniSetManager
{ {
public: public:
ObjectsActivator(); UniSetActivator();
ObjectsActivator( UniSetTypes::ObjectId id ); UniSetActivator( UniSetTypes::ObjectId id );
virtual ~ObjectsActivator(); virtual ~UniSetActivator();
virtual void run(bool thread); virtual void run(bool thread);
virtual void stop(); virtual void stop();
...@@ -57,7 +57,7 @@ class ObjectsActivator: ...@@ -57,7 +57,7 @@ class ObjectsActivator:
inline void oakill(int signo){ raise(signo);} inline void oakill(int signo){ raise(signo);}
virtual UniSetTypes::ObjectType getType(){ return UniSetTypes::getObjectType("ObjectsActivator"); } virtual UniSetTypes::ObjectType getType(){ return UniSetTypes::getObjectType("UniSetActivator"); }
protected: protected:
...@@ -102,8 +102,8 @@ class ObjectsActivator: ...@@ -102,8 +102,8 @@ class ObjectsActivator:
void term( int signo ); void term( int signo );
void init(); void init();
friend class ThreadCreator<ObjectsActivator>; friend class ThreadCreator<UniSetActivator>;
ThreadCreator<ObjectsActivator> *orbthr; ThreadCreator<UniSetActivator> *orbthr;
CORBA::ORB_var orb; CORBA::ORB_var orb;
...@@ -125,7 +125,7 @@ class ObjectsActivator: ...@@ -125,7 +125,7 @@ class ObjectsActivator:
struct MInfo: struct MInfo:
public Info public Info
{ {
ObjectsManager* mnr; UniSetManager* mnr;
}; };
std::list<OInfo> lstOInfo; std::list<OInfo> lstOInfo;
...@@ -135,7 +135,7 @@ class ObjectsActivator: ...@@ -135,7 +135,7 @@ class ObjectsActivator:
/* /*
template<class TClass> template<class TClass>
int ObjectsActivator::attach(TClass* p, void(TClass:: *f)(void*) ) int UniSetActivator::attach(TClass* p, void(TClass:: *f)(void*) )
{ {
if( next >= MAX_CHILD_THREAD ) if( next >= MAX_CHILD_THREAD )
return -1; return -1;
......
...@@ -22,20 +22,20 @@ ...@@ -22,20 +22,20 @@
* \author Pavel Vainerman * \author Pavel Vainerman
*/ */
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#ifndef ObjectsManager_H_ #ifndef UniSetManager_H_
#define ObjectsManager_H_ #define UniSetManager_H_
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include <omniORB4/CORBA.h> #include <omniORB4/CORBA.h>
#include "UniSetTypes.h" #include "UniSetTypes.h"
#include "UniSetObject.h" #include "UniSetObject.h"
#include "ObjectsManager_i.hh" #include "UniSetManager_i.hh"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class ObjectsActivator; class UniSetActivator;
class ObjectsManager; class UniSetManager;
typedef std::list<ObjectsManager*> ObjectsManagerList; typedef std::list<UniSetManager*> UniSetManagerList;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
/*! \class ObjectsManager /*! \class UniSetManager
* \par * \par
* Содержит в себе функции управления объектами. Их регистрации и т.п. * Содержит в себе функции управления объектами. Их регистрации и т.п.
* Создается менеджер объектов, после чего вызывается initObjects() * Создается менеджер объектов, после чего вызывается initObjects()
...@@ -44,45 +44,45 @@ typedef std::list<ObjectsManager*> ObjectsManagerList; ...@@ -44,45 +44,45 @@ typedef std::list<ObjectsManager*> ObjectsManagerList;
* Менеджер в свою очередь сам является объектом и обладает всеми его свойствами * Менеджер в свою очередь сам является объектом и обладает всеми его свойствами
* *
* Для пересылки сообщения всем подчиненным объектам используется * Для пересылки сообщения всем подчиненным объектам используется
* функция ObjectsManager::broadcast(const TransportMessage& msg) * функция UniSetManager::broadcast(const TransportMessage& msg)
* \par * \par
* У базового менеджера имеются базовые три функции см. ObjectsManager_i. * У базового менеджера имеются базовые три функции см. UniSetManager_i.
* \note Только при вызове функции ObjectsManager::broadcast() происходит * \note Только при вызове функции UniSetManager::broadcast() происходит
* формирование сообщения всем подчиненным объектам... Если команда проиходит * формирование сообщения всем подчиненным объектам... Если команда проиходит
* при помощи push, то пересылки всем починённым объектам не происходит... * при помощи push, то пересылки всем починённым объектам не происходит...
* *
* *
*/ */
class ObjectsManager: class UniSetManager:
public UniSetObject, public UniSetObject,
public POA_ObjectsManager_i public POA_UniSetManager_i
{ {
public: public:
ObjectsManager( UniSetTypes::ObjectId id); UniSetManager( UniSetTypes::ObjectId id);
ObjectsManager( const std::string& name, const std::string& section ); UniSetManager( const std::string& name, const std::string& section );
virtual ~ObjectsManager(); virtual ~UniSetManager();
virtual UniSetTypes::ObjectType getType(){ return UniSetTypes::getObjectType("ObjectsManager"); } virtual UniSetTypes::ObjectType getType(){ return UniSetTypes::getObjectType("UniSetManager"); }
// ------ функции объявленные в интерфейсе(IDL) ------ // ------ функции объявленные в интерфейсе(IDL) ------
virtual void broadcast(const UniSetTypes::TransportMessage& msg); virtual void broadcast(const UniSetTypes::TransportMessage& msg);
virtual UniSetTypes::SimpleInfoSeq* getObjectsInfo( CORBA::Long MaxLength=300 ); virtual UniSetTypes::SimpleInfoSeq* getObjectsInfo( CORBA::Long MaxLength=300 );
// -------------------------- // --------------------------
void initPOA(ObjectsManager* rmngr); void initPOA(UniSetManager* rmngr);
virtual bool addObject(UniSetObject *obj); virtual bool addObject(UniSetObject *obj);
virtual bool removeObject(UniSetObject *obj); virtual bool removeObject(UniSetObject *obj);
virtual bool addManager( ObjectsManager *mngr ); virtual bool addManager( UniSetManager *mngr );
virtual bool removeManager( ObjectsManager *mngr ); virtual bool removeManager( UniSetManager *mngr );
/*! Получение доступа к подчиненному менеджеру по идентификатору /*! Получение доступа к подчиненному менеджеру по идентификатору
* \return объект ненайден будет возвращен 0. * \return объект ненайден будет возвращен 0.
*/ */
const ObjectsManager* itemM(const UniSetTypes::ObjectId id); const UniSetManager* itemM(const UniSetTypes::ObjectId id);
/*! Получение доступа к подчиненному объекту по идентификатору /*! Получение доступа к подчиненному объекту по идентификатору
...@@ -92,12 +92,12 @@ class ObjectsManager: ...@@ -92,12 +92,12 @@ class ObjectsManager:
// Функции для аботы со списками подчиненных объектов // Функции для аботы со списками подчиненных объектов
inline ObjectsManagerList::const_iterator beginMList() inline UniSetManagerList::const_iterator beginMList()
{ {
return mlist.begin(); return mlist.begin();
} }
inline ObjectsManagerList::const_iterator endMList() inline UniSetManagerList::const_iterator endMList()
{ {
return mlist.end(); return mlist.end();
} }
...@@ -120,7 +120,7 @@ class ObjectsManager: ...@@ -120,7 +120,7 @@ class ObjectsManager:
protected: protected:
ObjectsManager(); UniSetManager();
enum OManagerCommand{deactiv, activ, initial, term}; enum OManagerCommand{deactiv, activ, initial, term};
...@@ -137,9 +137,9 @@ class ObjectsManager: ...@@ -137,9 +137,9 @@ class ObjectsManager:
virtual bool disactivateObject(); virtual bool disactivateObject();
typedef ObjectsManagerList::iterator MListIterator; typedef UniSetManagerList::iterator MListIterator;
int getObjectsInfo( ObjectsManager* mngr, UniSetTypes::SimpleInfoSeq* seq, int getObjectsInfo( UniSetManager* mngr, UniSetTypes::SimpleInfoSeq* seq,
int begin, const long uplimit ); int begin, const long uplimit );
PortableServer::POA_var poa; PortableServer::POA_var poa;
...@@ -147,10 +147,10 @@ class ObjectsManager: ...@@ -147,10 +147,10 @@ class ObjectsManager:
private: private:
friend class ObjectsActivator; friend class UniSetActivator;
int sig; int sig;
ObjectsManagerList mlist; UniSetManagerList mlist;
ObjectsList olist; ObjectsList olist;
UniSetTypes::uniset_rwmutex olistMutex; UniSetTypes::uniset_rwmutex olistMutex;
......
...@@ -21,24 +21,24 @@ ...@@ -21,24 +21,24 @@
* \author Pavel Vainerman * \author Pavel Vainerman
*/ */
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#ifndef ObjectsManager_LT_H_ #ifndef UniSetManager_LT_H_
#define ObjectsManager_LT_H_ #define UniSetManager_LT_H_
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#include "UniSetTypes.h" #include "UniSetTypes.h"
#include "ObjectsManager.h" #include "UniSetManager.h"
#include "LT_Object.h" #include "LT_Object.h"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
/*! /*!
Реализация базового класса с использованием локальных таймеров Реализация базового класса с использованием локальных таймеров
*/ */
class ObjectsManager_LT: class UniSetManager_LT:
public ObjectsManager public UniSetManager
{ {
public: public:
ObjectsManager_LT( UniSetTypes::ObjectId id ); UniSetManager_LT( UniSetTypes::ObjectId id );
ObjectsManager_LT(); UniSetManager_LT();
virtual ~ObjectsManager_LT(); virtual ~UniSetManager_LT();
protected: protected:
......
...@@ -37,15 +37,15 @@ ...@@ -37,15 +37,15 @@
#include "MessageType.h" #include "MessageType.h"
#include "PassiveTimer.h" #include "PassiveTimer.h"
#include "Exceptions.h" #include "Exceptions.h"
#include "UniversalInterface.h" #include "UInterface.h"
#include "UniSetObject_i.hh" #include "UniSetObject_i.hh"
#include "ThreadCreator.h" #include "ThreadCreator.h"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//#include <omnithread.h> //#include <omnithread.h>
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class ObjectsActivator; class UniSetActivator;
class ObjectsManager; class UniSetManager;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class UniSetObject; class UniSetObject;
...@@ -101,7 +101,7 @@ class UniSetObject: ...@@ -101,7 +101,7 @@ class UniSetObject:
/*! прервать ожидание сообщений */ /*! прервать ожидание сообщений */
void termWaiting(); void termWaiting();
UniversalInterface ui; /*!< универсальный интерфейс для работы с другими процессами */ UInterface ui; /*!< универсальный интерфейс для работы с другими процессами */
std::string myname; std::string myname;
std::string section; std::string section;
...@@ -183,14 +183,14 @@ class UniSetObject: ...@@ -183,14 +183,14 @@ class UniSetObject:
void setActive( bool set ); void setActive( bool set );
UniSetTypes::VoidMessage msg; UniSetTypes::VoidMessage msg;
ObjectsManager* mymngr; UniSetManager* mymngr;
void setThreadPriority( int p ); void setThreadPriority( int p );
private: private:
friend class ObjectsManager; friend class UniSetManager;
friend class ObjectsActivator; friend class UniSetActivator;
friend class ThreadCreator<UniSetObject>; friend class ThreadCreator<UniSetObject>;
inline pid_t getMsgPID() inline pid_t getMsgPID()
{ {
...@@ -200,7 +200,7 @@ class UniSetObject: ...@@ -200,7 +200,7 @@ class UniSetObject:
/*! функция потока */ /*! функция потока */
void work(); void work();
//! Инициализация параметров объекта //! Инициализация параметров объекта
bool init(ObjectsManager* om); bool init(UniSetManager* om);
//! Прямая деактивизация объекта //! Прямая деактивизация объекта
bool disactivate(); bool disactivate();
//! Непосредственная активизация объекта //! Непосредственная активизация объекта
......
...@@ -4,12 +4,12 @@ python_SCRIPTS = pyUniSet.py pyUConnector.py pyUModbus.py pyUExceptions.py ...@@ -4,12 +4,12 @@ python_SCRIPTS = pyUniSet.py pyUConnector.py pyUModbus.py pyUExceptions.py
pyexec_LTLIBRARIES = _pyUConnector.la _pyUModbus.la _pyUExceptions.la _pyUniSet.la pyexec_LTLIBRARIES = _pyUConnector.la _pyUModbus.la _pyUExceptions.la _pyUniSet.la
_pyUniSet_la_SOURCES = UInterface.cc UInterface_wrap.cxx _pyUniSet_la_SOURCES = pyUInterface.cc UInterface_wrap.cxx
_pyUniSet_la_CXXFLAGS = $(UNISET_CFLAGS) $(PYTHON_CFLAGS) _pyUniSet_la_CXXFLAGS = $(UNISET_CFLAGS) $(PYTHON_CFLAGS)
_pyUniSet_la_LDFLAGS = -module -avoid-version _pyUniSet_la_LDFLAGS = -module -avoid-version
_pyUniSet_la_LIBADD = $(UNISET_LIBS) $(PYTHON_LIBS) _pyUniSet_la_LIBADD = $(UNISET_LIBS) $(PYTHON_LIBS)
UInterface_wrap.cxx: UInterface.i UInterface.h UInterface_wrap.cxx: UInterface.i pyUInterface.h
swig -python -c++ -classic UInterface.i swig -python -c++ -classic UInterface.i
_pyUConnector_la_SOURCES = UConnector.cc UConnector_wrap.cxx _pyUConnector_la_SOURCES = UConnector.cc UConnector_wrap.cxx
......
...@@ -11,7 +11,7 @@ xmlfile(xfile) ...@@ -11,7 +11,7 @@ xmlfile(xfile)
try try
{ {
conf = new UniSetTypes::Configuration(p->argc,p->argv,xmlfile); conf = new UniSetTypes::Configuration(p->argc,p->argv,xmlfile);
ui = new UniversalInterface(conf); ui = new UInterface(conf);
} }
catch( UniSetTypes::Exception& ex ) catch( UniSetTypes::Exception& ex )
{ {
...@@ -31,7 +31,7 @@ xmlfile(xfile) ...@@ -31,7 +31,7 @@ xmlfile(xfile)
try try
{ {
conf = new UniSetTypes::Configuration(argc,argv,xmlfile); conf = new UniSetTypes::Configuration(argc,argv,xmlfile);
ui = new UniversalInterface(conf); ui = new UInterface(conf);
} }
catch( UniSetTypes::Exception& ex ) catch( UniSetTypes::Exception& ex )
{ {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
#define UConnector_H_ #define UConnector_H_
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include <string> #include <string>
#include <Configuration.h> #include "Configuration.h"
#include <UniversalInterface.h> #include "UInterface.h"
#include "UTypes.h" #include "UTypes.h"
#include "UExceptions.h" #include "UExceptions.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
...@@ -30,7 +30,7 @@ class UConnector ...@@ -30,7 +30,7 @@ class UConnector
private: private:
UniSetTypes::Configuration* conf; UniSetTypes::Configuration* conf;
UniversalInterface* ui; UInterface* ui;
const char* xmlfile; const char* xmlfile;
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -11,5 +11,4 @@ ...@@ -11,5 +11,4 @@
/* Для генерации классов и констант в Питоне */ /* Для генерации классов и констант в Питоне */
%include "UTypes.h" %include "UTypes.h"
//%include "UExceptions.h"
%include "UConnector.h" %include "UConnector.h"
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
%module pyUniSet %module pyUniSet
%{ %{
#include "UInterface.h" #include "pyUInterface.h"
%} %}
/* Для генерации классов и констант в Питоне */ /* Для генерации классов и констант в Питоне */
%include "UInterface.h" %include "pyUInterface.h"
%include "UTypes.h" %include "UTypes.h"
%include "UExceptions.h" %include "UExceptions.h"
...@@ -3055,7 +3055,7 @@ namespace swig { ...@@ -3055,7 +3055,7 @@ namespace swig {
} }
#include "UInterface.h" #include "pyUInterface.h"
SWIGINTERN swig_type_info* SWIGINTERN swig_type_info*
...@@ -3366,7 +3366,7 @@ SWIGINTERN PyObject *_wrap_uniset_init_params(PyObject *SWIGUNUSEDPARM(self), Py ...@@ -3366,7 +3366,7 @@ SWIGINTERN PyObject *_wrap_uniset_init_params(PyObject *SWIGUNUSEDPARM(self), Py
} }
arg2 = reinterpret_cast< char * >(buf2); arg2 = reinterpret_cast< char * >(buf2);
try { try {
UInterface::uniset_init_params(arg1,(char const *)arg2); pyUInterface::uniset_init_params(arg1,(char const *)arg2);
} }
catch(UException &_e) { catch(UException &_e) {
SWIG_Python_Raise(SWIG_NewPointerObj((new UException(static_cast< const UException& >(_e))),SWIGTYPE_p_UException,SWIG_POINTER_OWN), "UException", SWIGTYPE_p_UException); SWIG_fail; SWIG_Python_Raise(SWIG_NewPointerObj((new UException(static_cast< const UException& >(_e))),SWIGTYPE_p_UException,SWIG_POINTER_OWN), "UException", SWIGTYPE_p_UException); SWIG_fail;
...@@ -3414,7 +3414,7 @@ SWIGINTERN PyObject *_wrap_uniset_init(PyObject *SWIGUNUSEDPARM(self), PyObject ...@@ -3414,7 +3414,7 @@ SWIGINTERN PyObject *_wrap_uniset_init(PyObject *SWIGUNUSEDPARM(self), PyObject
} }
arg3 = reinterpret_cast< char * >(buf3); arg3 = reinterpret_cast< char * >(buf3);
try { try {
UInterface::uniset_init(arg1,arg2,(char const *)arg3); pyUInterface::uniset_init(arg1,arg2,(char const *)arg3);
} }
catch(UException &_e) { catch(UException &_e) {
SWIG_Python_Raise(SWIG_NewPointerObj((new UException(static_cast< const UException& >(_e))),SWIGTYPE_p_UException,SWIG_POINTER_OWN), "UException", SWIGTYPE_p_UException); SWIG_fail; SWIG_Python_Raise(SWIG_NewPointerObj((new UException(static_cast< const UException& >(_e))),SWIGTYPE_p_UException,SWIG_POINTER_OWN), "UException", SWIGTYPE_p_UException); SWIG_fail;
...@@ -3444,7 +3444,7 @@ SWIGINTERN PyObject *_wrap_getValue(PyObject *SWIGUNUSEDPARM(self), PyObject *ar ...@@ -3444,7 +3444,7 @@ SWIGINTERN PyObject *_wrap_getValue(PyObject *SWIGUNUSEDPARM(self), PyObject *ar
} }
arg1 = static_cast< long >(val1); arg1 = static_cast< long >(val1);
try { try {
result = (long)UInterface::getValue(arg1); result = (long)pyUInterface::getValue(arg1);
} }
catch(UException &_e) { catch(UException &_e) {
SWIG_Python_Raise(SWIG_NewPointerObj((new UException(static_cast< const UException& >(_e))),SWIGTYPE_p_UException,SWIG_POINTER_OWN), "UException", SWIGTYPE_p_UException); SWIG_fail; SWIG_Python_Raise(SWIG_NewPointerObj((new UException(static_cast< const UException& >(_e))),SWIGTYPE_p_UException,SWIG_POINTER_OWN), "UException", SWIGTYPE_p_UException); SWIG_fail;
...@@ -3480,7 +3480,7 @@ SWIGINTERN PyObject *_wrap_setValue(PyObject *SWIGUNUSEDPARM(self), PyObject *ar ...@@ -3480,7 +3480,7 @@ SWIGINTERN PyObject *_wrap_setValue(PyObject *SWIGUNUSEDPARM(self), PyObject *ar
} }
arg2 = static_cast< long >(val2); arg2 = static_cast< long >(val2);
try { try {
UInterface::setValue(arg1,arg2); pyUInterface::setValue(arg1,arg2);
} }
catch(UException &_e) { catch(UException &_e) {
SWIG_Python_Raise(SWIG_NewPointerObj((new UException(static_cast< const UException& >(_e))),SWIGTYPE_p_UException,SWIG_POINTER_OWN), "UException", SWIGTYPE_p_UException); SWIG_fail; SWIG_Python_Raise(SWIG_NewPointerObj((new UException(static_cast< const UException& >(_e))),SWIGTYPE_p_UException,SWIG_POINTER_OWN), "UException", SWIGTYPE_p_UException); SWIG_fail;
...@@ -3508,7 +3508,7 @@ SWIGINTERN PyObject *_wrap_getSensorID(PyObject *SWIGUNUSEDPARM(self), PyObject ...@@ -3508,7 +3508,7 @@ SWIGINTERN PyObject *_wrap_getSensorID(PyObject *SWIGUNUSEDPARM(self), PyObject
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getSensorID" "', argument " "1"" of type '" "char const *""'"); SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getSensorID" "', argument " "1"" of type '" "char const *""'");
} }
arg1 = reinterpret_cast< char * >(buf1); arg1 = reinterpret_cast< char * >(buf1);
result = (long)UInterface::getSensorID((char const *)arg1); result = (long)pyUInterface::getSensorID((char const *)arg1);
resultobj = SWIG_From_long(static_cast< long >(result)); resultobj = SWIG_From_long(static_cast< long >(result));
if (alloc1 == SWIG_NEWOBJ) delete[] buf1; if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
return resultobj; return resultobj;
...@@ -3532,7 +3532,7 @@ SWIGINTERN PyObject *_wrap_getShortName(PyObject *SWIGUNUSEDPARM(self), PyObject ...@@ -3532,7 +3532,7 @@ SWIGINTERN PyObject *_wrap_getShortName(PyObject *SWIGUNUSEDPARM(self), PyObject
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getShortName" "', argument " "1"" of type '" "long""'"); SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getShortName" "', argument " "1"" of type '" "long""'");
} }
arg1 = static_cast< long >(val1); arg1 = static_cast< long >(val1);
result = (char *)UInterface::getShortName(arg1); result = (char *)pyUInterface::getShortName(arg1);
resultobj = SWIG_FromCharPtr((const char *)result); resultobj = SWIG_FromCharPtr((const char *)result);
return resultobj; return resultobj;
fail: fail:
...@@ -3554,7 +3554,7 @@ SWIGINTERN PyObject *_wrap_getName(PyObject *SWIGUNUSEDPARM(self), PyObject *arg ...@@ -3554,7 +3554,7 @@ SWIGINTERN PyObject *_wrap_getName(PyObject *SWIGUNUSEDPARM(self), PyObject *arg
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getName" "', argument " "1"" of type '" "long""'"); SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getName" "', argument " "1"" of type '" "long""'");
} }
arg1 = static_cast< long >(val1); arg1 = static_cast< long >(val1);
result = (char *)UInterface::getName(arg1); result = (char *)pyUInterface::getName(arg1);
resultobj = SWIG_FromCharPtr((const char *)result); resultobj = SWIG_FromCharPtr((const char *)result);
return resultobj; return resultobj;
fail: fail:
...@@ -3576,7 +3576,7 @@ SWIGINTERN PyObject *_wrap_getTextName(PyObject *SWIGUNUSEDPARM(self), PyObject ...@@ -3576,7 +3576,7 @@ SWIGINTERN PyObject *_wrap_getTextName(PyObject *SWIGUNUSEDPARM(self), PyObject
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getTextName" "', argument " "1"" of type '" "long""'"); SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getTextName" "', argument " "1"" of type '" "long""'");
} }
arg1 = static_cast< long >(val1); arg1 = static_cast< long >(val1);
result = (char *)UInterface::getTextName(arg1); result = (char *)pyUInterface::getTextName(arg1);
resultobj = SWIG_FromCharPtr((const char *)result); resultobj = SWIG_FromCharPtr((const char *)result);
return resultobj; return resultobj;
fail: fail:
...@@ -3589,7 +3589,7 @@ SWIGINTERN PyObject *_wrap_getConfFileName(PyObject *SWIGUNUSEDPARM(self), PyObj ...@@ -3589,7 +3589,7 @@ SWIGINTERN PyObject *_wrap_getConfFileName(PyObject *SWIGUNUSEDPARM(self), PyObj
char *result = 0 ; char *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)":getConfFileName")) SWIG_fail; if (!PyArg_ParseTuple(args,(char *)":getConfFileName")) SWIG_fail;
result = (char *)UInterface::getConfFileName(); result = (char *)pyUInterface::getConfFileName();
resultobj = SWIG_FromCharPtr((const char *)result); resultobj = SWIG_FromCharPtr((const char *)result);
return resultobj; return resultobj;
fail: fail:
......
#ifndef UModbus_H_ #ifndef UModbus_H_
#define UModbus_H_ #define UModbus_H_
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include <Configuration.h> #include "Configuration.h"
#include <UniversalInterface.h> #include "UInterface.h"
#include <modbus/ModbusTCPMaster.h> #include "modbus/ModbusTCPMaster.h"
#include <modbus/ModbusTypes.h> #include "modbus/ModbusTypes.h"
#include <extensions/VTypes.h> #include "extensions/VTypes.h"
#include <Debug.h> #include "Debug.h"
#include "UTypes.h" #include "UTypes.h"
#include "UExceptions.h" #include "UExceptions.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
......
...@@ -12,4 +12,4 @@ ...@@ -12,4 +12,4 @@
/* Для генерации классов и констант в Питоне */ /* Для генерации классов и констант в Питоне */
%include "UModbus.h" %include "UModbus.h"
%include "UTypes.h" %include "UTypes.h"
//%include "UExceptions.h" %include "UExceptions.h"
...@@ -2952,12 +2952,14 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { ...@@ -2952,12 +2952,14 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
#define SWIGTYPE_p_UException swig_types[0] #define SWIGTYPE_p_UException swig_types[0]
#define SWIGTYPE_p_UModbus swig_types[1] #define SWIGTYPE_p_UModbus swig_types[1]
#define SWIGTYPE_p_UTypes__Params swig_types[2] #define SWIGTYPE_p_USysError swig_types[2]
#define SWIGTYPE_p_char swig_types[3] #define SWIGTYPE_p_UTimeOut swig_types[3]
#define SWIGTYPE_p_p_char swig_types[4] #define SWIGTYPE_p_UTypes__Params swig_types[4]
#define SWIGTYPE_p_std__string swig_types[5] #define SWIGTYPE_p_char swig_types[5]
static swig_type_info *swig_types[7]; #define SWIGTYPE_p_p_char swig_types[6]
static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0}; #define SWIGTYPE_p_std__string swig_types[7]
static swig_type_info *swig_types[9];
static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
...@@ -5209,6 +5211,413 @@ SWIGINTERN PyObject *Params_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObjec ...@@ -5209,6 +5211,413 @@ SWIGINTERN PyObject *Params_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObjec
return SWIG_Py_Void(); return SWIG_Py_Void();
} }
SWIGINTERN PyObject *_wrap_new_UException__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
UException *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)":new_UException")) SWIG_fail;
result = (UException *)new UException();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_UException, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_new_UException__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::string *arg1 = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
UException *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:new_UException",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__string, 0 | 0);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_UException" "', argument " "1"" of type '" "std::string const &""'");
}
if (!argp1) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_UException" "', argument " "1"" of type '" "std::string const &""'");
}
arg1 = reinterpret_cast< std::string * >(argp1);
result = (UException *)new UException((std::string const &)*arg1);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_UException, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_new_UException__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
char *arg1 = (char *) 0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
PyObject * obj0 = 0 ;
UException *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:new_UException",&obj0)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_UException" "', argument " "1"" of type '" "char const *""'");
}
arg1 = reinterpret_cast< char * >(buf1);
result = (UException *)new UException((char const *)arg1);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_UException, SWIG_POINTER_NEW | 0 );
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
return resultobj;
fail:
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
return NULL;
}
SWIGINTERN PyObject *_wrap_new_UException(PyObject *self, PyObject *args) {
int argc;
PyObject *argv[2];
int ii;
if (!PyTuple_Check(args)) SWIG_fail;
argc = args ? (int)PyObject_Length(args) : 0;
for (ii = 0; (ii < 1) && (ii < argc); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii);
}
if (argc == 0) {
return _wrap_new_UException__SWIG_0(self, args);
}
if (argc == 1) {
int _v;
int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__string, 0);
_v = SWIG_CheckState(res);
if (_v) {
return _wrap_new_UException__SWIG_1(self, args);
}
}
if (argc == 1) {
int _v;
int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
_v = SWIG_CheckState(res);
if (_v) {
return _wrap_new_UException__SWIG_2(self, args);
}
}
fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_UException'.\n"
" Possible C/C++ prototypes are:\n"
" UException::UException()\n"
" UException::UException(std::string const &)\n"
" UException::UException(char const *)\n");
return 0;
}
SWIGINTERN PyObject *_wrap_delete_UException(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
UException *arg1 = (UException *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete_UException",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_UException, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_UException" "', argument " "1"" of type '" "UException *""'");
}
arg1 = reinterpret_cast< UException * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_UException_getError(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
UException *arg1 = (UException *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
char *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:UException_getError",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_UException, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "UException_getError" "', argument " "1"" of type '" "UException *""'");
}
arg1 = reinterpret_cast< UException * >(argp1);
result = (char *)(arg1)->getError();
resultobj = SWIG_FromCharPtr((const char *)result);
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_UException_err_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
UException *arg1 = (UException *) 0 ;
std::string arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 ;
int res2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:UException_err_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_UException, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "UException_err_set" "', argument " "1"" of type '" "UException *""'");
}
arg1 = reinterpret_cast< UException * >(argp1);
{
res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__string, 0 | 0);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "UException_err_set" "', argument " "2"" of type '" "std::string""'");
}
if (!argp2) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "UException_err_set" "', argument " "2"" of type '" "std::string""'");
} else {
std::string * temp = reinterpret_cast< std::string * >(argp2);
arg2 = *temp;
if (SWIG_IsNewObj(res2)) delete temp;
}
}
if (arg1) (arg1)->err = arg2;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_UException_err_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
UException *arg1 = (UException *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
std::string result;
if (!PyArg_ParseTuple(args,(char *)"O:UException_err_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_UException, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "UException_err_get" "', argument " "1"" of type '" "UException *""'");
}
arg1 = reinterpret_cast< UException * >(argp1);
result = ((arg1)->err);
resultobj = SWIG_NewPointerObj((new std::string(static_cast< const std::string& >(result))), SWIGTYPE_p_std__string, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *UException_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_UException, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN PyObject *_wrap_new_UTimeOut__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
UTimeOut *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)":new_UTimeOut")) SWIG_fail;
result = (UTimeOut *)new UTimeOut();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_UTimeOut, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_new_UTimeOut__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::string *arg1 = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
UTimeOut *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:new_UTimeOut",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__string, 0 | 0);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_UTimeOut" "', argument " "1"" of type '" "std::string const &""'");
}
if (!argp1) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_UTimeOut" "', argument " "1"" of type '" "std::string const &""'");
}
arg1 = reinterpret_cast< std::string * >(argp1);
result = (UTimeOut *)new UTimeOut((std::string const &)*arg1);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_UTimeOut, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_new_UTimeOut(PyObject *self, PyObject *args) {
int argc;
PyObject *argv[2];
int ii;
if (!PyTuple_Check(args)) SWIG_fail;
argc = args ? (int)PyObject_Length(args) : 0;
for (ii = 0; (ii < 1) && (ii < argc); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii);
}
if (argc == 0) {
return _wrap_new_UTimeOut__SWIG_0(self, args);
}
if (argc == 1) {
int _v;
int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__string, 0);
_v = SWIG_CheckState(res);
if (_v) {
return _wrap_new_UTimeOut__SWIG_1(self, args);
}
}
fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_UTimeOut'.\n"
" Possible C/C++ prototypes are:\n"
" UTimeOut::UTimeOut()\n"
" UTimeOut::UTimeOut(std::string const &)\n");
return 0;
}
SWIGINTERN PyObject *_wrap_delete_UTimeOut(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
UTimeOut *arg1 = (UTimeOut *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete_UTimeOut",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_UTimeOut, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_UTimeOut" "', argument " "1"" of type '" "UTimeOut *""'");
}
arg1 = reinterpret_cast< UTimeOut * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *UTimeOut_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_UTimeOut, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
SWIGINTERN PyObject *_wrap_new_USysError__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
USysError *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)":new_USysError")) SWIG_fail;
result = (USysError *)new USysError();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_USysError, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_new_USysError__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::string *arg1 = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
USysError *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:new_USysError",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__string, 0 | 0);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_USysError" "', argument " "1"" of type '" "std::string const &""'");
}
if (!argp1) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_USysError" "', argument " "1"" of type '" "std::string const &""'");
}
arg1 = reinterpret_cast< std::string * >(argp1);
result = (USysError *)new USysError((std::string const &)*arg1);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_USysError, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_new_USysError(PyObject *self, PyObject *args) {
int argc;
PyObject *argv[2];
int ii;
if (!PyTuple_Check(args)) SWIG_fail;
argc = args ? (int)PyObject_Length(args) : 0;
for (ii = 0; (ii < 1) && (ii < argc); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii);
}
if (argc == 0) {
return _wrap_new_USysError__SWIG_0(self, args);
}
if (argc == 1) {
int _v;
int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__string, 0);
_v = SWIG_CheckState(res);
if (_v) {
return _wrap_new_USysError__SWIG_1(self, args);
}
}
fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_USysError'.\n"
" Possible C/C++ prototypes are:\n"
" USysError::USysError()\n"
" USysError::USysError(std::string const &)\n");
return 0;
}
SWIGINTERN PyObject *_wrap_delete_USysError(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
USysError *arg1 = (USysError *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:delete_USysError",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_USysError, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_USysError" "', argument " "1"" of type '" "USysError *""'");
}
arg1 = reinterpret_cast< USysError * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *USysError_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_USysError, SWIG_NewClientData(obj));
return SWIG_Py_Void();
}
static PyMethodDef SwigMethods[] = { static PyMethodDef SwigMethods[] = {
{ (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
{ (char *)"new_UModbus", _wrap_new_UModbus, METH_VARARGS, NULL}, { (char *)"new_UModbus", _wrap_new_UModbus, METH_VARARGS, NULL},
...@@ -5236,14 +5645,34 @@ static PyMethodDef SwigMethods[] = { ...@@ -5236,14 +5645,34 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"Params_inst", _wrap_Params_inst, METH_VARARGS, NULL}, { (char *)"Params_inst", _wrap_Params_inst, METH_VARARGS, NULL},
{ (char *)"delete_Params", _wrap_delete_Params, METH_VARARGS, NULL}, { (char *)"delete_Params", _wrap_delete_Params, METH_VARARGS, NULL},
{ (char *)"Params_swigregister", Params_swigregister, METH_VARARGS, NULL}, { (char *)"Params_swigregister", Params_swigregister, METH_VARARGS, NULL},
{ (char *)"new_UException", _wrap_new_UException, METH_VARARGS, NULL},
{ (char *)"delete_UException", _wrap_delete_UException, METH_VARARGS, NULL},
{ (char *)"UException_getError", _wrap_UException_getError, METH_VARARGS, NULL},
{ (char *)"UException_err_set", _wrap_UException_err_set, METH_VARARGS, NULL},
{ (char *)"UException_err_get", _wrap_UException_err_get, METH_VARARGS, NULL},
{ (char *)"UException_swigregister", UException_swigregister, METH_VARARGS, NULL},
{ (char *)"new_UTimeOut", _wrap_new_UTimeOut, METH_VARARGS, NULL},
{ (char *)"delete_UTimeOut", _wrap_delete_UTimeOut, METH_VARARGS, NULL},
{ (char *)"UTimeOut_swigregister", UTimeOut_swigregister, METH_VARARGS, NULL},
{ (char *)"new_USysError", _wrap_new_USysError, METH_VARARGS, NULL},
{ (char *)"delete_USysError", _wrap_delete_USysError, METH_VARARGS, NULL},
{ (char *)"USysError_swigregister", USysError_swigregister, METH_VARARGS, NULL},
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
static void *_p_UTimeOutTo_p_UException(void *x, int *SWIGUNUSEDPARM(newmemory)) {
return (void *)((UException *) ((UTimeOut *) x));
}
static void *_p_USysErrorTo_p_UException(void *x, int *SWIGUNUSEDPARM(newmemory)) {
return (void *)((UException *) ((USysError *) x));
}
static swig_type_info _swigt__p_UException = {"_p_UException", "UException *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_UException = {"_p_UException", "UException *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_UModbus = {"_p_UModbus", "UModbus *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_UModbus = {"_p_UModbus", "UModbus *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_USysError = {"_p_USysError", "USysError *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_UTimeOut = {"_p_UTimeOut", "UTimeOut *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_UTypes__Params = {"_p_UTypes__Params", "UTypes::Params *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_UTypes__Params = {"_p_UTypes__Params", "UTypes::Params *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
...@@ -5252,14 +5681,18 @@ static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *" ...@@ -5252,14 +5681,18 @@ static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *"
static swig_type_info *swig_type_initial[] = { static swig_type_info *swig_type_initial[] = {
&_swigt__p_UException, &_swigt__p_UException,
&_swigt__p_UModbus, &_swigt__p_UModbus,
&_swigt__p_USysError,
&_swigt__p_UTimeOut,
&_swigt__p_UTypes__Params, &_swigt__p_UTypes__Params,
&_swigt__p_char, &_swigt__p_char,
&_swigt__p_p_char, &_swigt__p_p_char,
&_swigt__p_std__string, &_swigt__p_std__string,
}; };
static swig_cast_info _swigc__p_UException[] = { {&_swigt__p_UException, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_UException[] = { {&_swigt__p_UException, 0, 0, 0}, {&_swigt__p_UTimeOut, _p_UTimeOutTo_p_UException, 0, 0}, {&_swigt__p_USysError, _p_USysErrorTo_p_UException, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_UModbus[] = { {&_swigt__p_UModbus, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_UModbus[] = { {&_swigt__p_UModbus, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_USysError[] = { {&_swigt__p_USysError, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_UTimeOut[] = { {&_swigt__p_UTimeOut, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_UTypes__Params[] = { {&_swigt__p_UTypes__Params, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_UTypes__Params[] = { {&_swigt__p_UTypes__Params, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
...@@ -5268,6 +5701,8 @@ static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0 ...@@ -5268,6 +5701,8 @@ static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0
static swig_cast_info *swig_cast_initial[] = { static swig_cast_info *swig_cast_initial[] = {
_swigc__p_UException, _swigc__p_UException,
_swigc__p_UModbus, _swigc__p_UModbus,
_swigc__p_USysError,
_swigc__p_UTimeOut,
_swigc__p_UTypes__Params, _swigc__p_UTypes__Params,
_swigc__p_char, _swigc__p_char,
_swigc__p_p_char, _swigc__p_p_char,
......
#include <ostream> #include <ostream>
#include <Exceptions.h> #include "Exceptions.h"
#include <ORepHelpers.h> #include "ORepHelpers.h"
#include <UniversalInterface.h>
#include <Configuration.h>
#include <UniSetTypes.h>
#include "UInterface.h" #include "UInterface.h"
#include "Configuration.h"
#include "UniSetTypes.h"
#include "pyUInterface.h"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
using namespace std; using namespace std;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
static UniversalInterface* ui=0; static UInterface* ui=0;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void UInterface::uniset_init_params( UTypes::Params* p, const char* xmlfile )throw(UException) void pyUInterface::uniset_init_params( UTypes::Params* p, const char* xmlfile )throw(UException)
{ {
UInterface::uniset_init(p->argc,p->argv,xmlfile); pyUInterface::uniset_init(p->argc,p->argv,xmlfile);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void UInterface::uniset_init( int argc, char* argv[], const char* xmlfile )throw(UException) void pyUInterface::uniset_init( int argc, char* argv[], const char* xmlfile )throw(UException)
{ {
try try
{ {
UniSetTypes::uniset_init(argc,argv,xmlfile); UniSetTypes::uniset_init(argc,argv,xmlfile);
ui = new UniversalInterface(); ui = new UInterface();
return; return;
} }
catch( UniSetTypes::Exception& ex ) catch( UniSetTypes::Exception& ex )
...@@ -34,7 +34,7 @@ void UInterface::uniset_init( int argc, char* argv[], const char* xmlfile )throw ...@@ -34,7 +34,7 @@ void UInterface::uniset_init( int argc, char* argv[], const char* xmlfile )throw
} }
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
long UInterface::getValue( long id )throw(UException) long pyUInterface::getValue( long id )throw(UException)
{ {
if( !UniSetTypes::conf || !ui ) if( !UniSetTypes::conf || !ui )
throw USysError(); throw USysError();
...@@ -75,7 +75,7 @@ long UInterface::getValue( long id )throw(UException) ...@@ -75,7 +75,7 @@ long UInterface::getValue( long id )throw(UException)
throw UException("(getValue): unknown error"); throw UException("(getValue): unknown error");
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void UInterface::setValue( long id, long val )throw(UException) void pyUInterface::setValue( long id, long val )throw(UException)
{ {
if( !UniSetTypes::conf || !ui ) if( !UniSetTypes::conf || !ui )
throw USysError(); throw USysError();
...@@ -114,7 +114,7 @@ void UInterface::setValue( long id, long val )throw(UException) ...@@ -114,7 +114,7 @@ void UInterface::setValue( long id, long val )throw(UException)
} }
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
long UInterface::getSensorID( const char* name ) long pyUInterface::getSensorID( const char* name )
{ {
if( UniSetTypes::conf ) if( UniSetTypes::conf )
return UniSetTypes::conf->getSensorID(name); return UniSetTypes::conf->getSensorID(name);
...@@ -122,7 +122,7 @@ long UInterface::getSensorID( const char* name ) ...@@ -122,7 +122,7 @@ long UInterface::getSensorID( const char* name )
return -1; return -1;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
const char* UInterface::getName( long id ) const char* pyUInterface::getName( long id )
{ {
if( UniSetTypes::conf ) if( UniSetTypes::conf )
return UniSetTypes::conf->oind->getMapName(id).c_str(); return UniSetTypes::conf->oind->getMapName(id).c_str();
...@@ -130,7 +130,7 @@ const char* UInterface::getName( long id ) ...@@ -130,7 +130,7 @@ const char* UInterface::getName( long id )
return ""; return "";
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
const char* UInterface::getShortName( long id ) const char* pyUInterface::getShortName( long id )
{ {
if( UniSetTypes::conf ) if( UniSetTypes::conf )
return ORepHelpers::getShortName(UniSetTypes::conf->oind->getMapName(id)).c_str(); return ORepHelpers::getShortName(UniSetTypes::conf->oind->getMapName(id)).c_str();
...@@ -138,7 +138,7 @@ const char* UInterface::getShortName( long id ) ...@@ -138,7 +138,7 @@ const char* UInterface::getShortName( long id )
return ""; return "";
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
const char* UInterface::getTextName( long id ) const char* pyUInterface::getTextName( long id )
{ {
if( UniSetTypes::conf ) if( UniSetTypes::conf )
return UniSetTypes::conf->oind->getTextName(id).c_str(); return UniSetTypes::conf->oind->getTextName(id).c_str();
...@@ -146,7 +146,7 @@ const char* UInterface::getTextName( long id ) ...@@ -146,7 +146,7 @@ const char* UInterface::getTextName( long id )
return ""; return "";
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
const char* UInterface::getConfFileName() const char* pyUInterface::getConfFileName()
{ {
if( UniSetTypes::conf ) if( UniSetTypes::conf )
return UniSetTypes::conf->getConfFileName().c_str(); return UniSetTypes::conf->getConfFileName().c_str();
......
#ifndef UInterface_H_ #ifndef pyUInterface_H_
#define UInterface_H_ #define pyUInterface_H_
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include <string> #include <string>
#include "UTypes.h" #include "UTypes.h"
#include "UExceptions.h" #include "UExceptions.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
namespace UInterface namespace pyUInterface
{ {
void uniset_init_params( UTypes::Params* p, const char* xmlfile )throw(UException); void uniset_init_params( UTypes::Params* p, const char* xmlfile )throw(UException);
void uniset_init( int argc, char** argv, const char* xmlfile )throw(UException); void uniset_init( int argc, char** argv, const char* xmlfile )throw(UException);
......
...@@ -111,4 +111,56 @@ def Params_inst(): ...@@ -111,4 +111,56 @@ def Params_inst():
return _pyUModbus.Params_inst() return _pyUModbus.Params_inst()
Params_inst = _pyUModbus.Params_inst Params_inst = _pyUModbus.Params_inst
class UException(Exception):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, UException, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, UException, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUModbus.new_UException(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _pyUModbus.delete_UException
__del__ = lambda self : None;
def getError(self): return _pyUModbus.UException_getError(self)
__swig_setmethods__["err"] = _pyUModbus.UException_err_set
__swig_getmethods__["err"] = _pyUModbus.UException_err_get
UException_swigregister = _pyUModbus.UException_swigregister
UException_swigregister(UException)
class UTimeOut(UException):
__swig_setmethods__ = {}
for _s in [UException]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, UTimeOut, name, value)
__swig_getmethods__ = {}
for _s in [UException]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, UTimeOut, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUModbus.new_UTimeOut(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _pyUModbus.delete_UTimeOut
__del__ = lambda self : None;
UTimeOut_swigregister = _pyUModbus.UTimeOut_swigregister
UTimeOut_swigregister(UTimeOut)
class USysError(UException):
__swig_setmethods__ = {}
for _s in [UException]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, USysError, name, value)
__swig_getmethods__ = {}
for _s in [UException]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, USysError, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUModbus.new_USysError(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _pyUModbus.delete_USysError
__del__ = lambda self : None;
USysError_swigregister = _pyUModbus.USysError_swigregister
USysError_swigregister(USysError)
# This file is compatible with both classic and new-style classes. # This file is compatible with both classic and new-style classes.
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
############################################################################ ############################################################################
noinst_LTLIBRARIES = libInterfaces.la noinst_LTLIBRARIES = libInterfaces.la
libInterfaces_la_SOURCES = UniversalInterface.cc libInterfaces_la_SOURCES = UInterface.cc
include $(top_builddir)/conf/setting.mk include $(top_builddir)/conf/setting.mk
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include "ORepHelpers.h" #include "ORepHelpers.h"
#include "UniversalInterface.h" #include "UInterface.h"
//#include "Debug.h" //#include "Debug.h"
#include "Configuration.h" #include "Configuration.h"
#include "PassiveTimer.h" #include "PassiveTimer.h"
...@@ -40,7 +40,7 @@ using namespace UniversalIO; ...@@ -40,7 +40,7 @@ using namespace UniversalIO;
using namespace UniSetTypes; using namespace UniSetTypes;
using namespace std; using namespace std;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
UniversalInterface::UniversalInterface( UniSetTypes::Configuration* _uconf ): UInterface::UInterface( UniSetTypes::Configuration* _uconf ):
rep(_uconf), rep(_uconf),
myid(UniSetTypes::DefaultObjectId), myid(UniSetTypes::DefaultObjectId),
orb(CORBA::ORB::_nil()), orb(CORBA::ORB::_nil()),
...@@ -51,7 +51,7 @@ UniversalInterface::UniversalInterface( UniSetTypes::Configuration* _uconf ): ...@@ -51,7 +51,7 @@ UniversalInterface::UniversalInterface( UniSetTypes::Configuration* _uconf ):
init(); init();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
UniversalInterface::UniversalInterface( ObjectId backid, CORBA::ORB_var orb, ObjectIndex* _oind ): UInterface::UInterface( ObjectId backid, CORBA::ORB_var orb, ObjectIndex* _oind ):
rep(UniSetTypes::conf), rep(UniSetTypes::conf),
myid(backid), myid(backid),
orb(orb), orb(orb),
...@@ -65,11 +65,11 @@ UniversalInterface::UniversalInterface( ObjectId backid, CORBA::ORB_var orb, Obj ...@@ -65,11 +65,11 @@ UniversalInterface::UniversalInterface( ObjectId backid, CORBA::ORB_var orb, Obj
init(); init();
} }
UniversalInterface::~UniversalInterface() UInterface::~UInterface()
{ {
} }
void UniversalInterface::init() void UInterface::init()
{ {
// пытаемся получить ссылку на NameSerivice // пытаемся получить ссылку на NameSerivice
// в любом случае. даже если включён режим // в любом случае. даже если включён режим
...@@ -104,7 +104,7 @@ void UniversalInterface::init() ...@@ -104,7 +104,7 @@ void UniversalInterface::init()
} }
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
void UniversalInterface::initBackId( UniSetTypes::ObjectId backid ) void UInterface::initBackId( UniSetTypes::ObjectId backid )
{ {
myid = backid; myid = backid;
} }
...@@ -115,7 +115,7 @@ void UniversalInterface::initBackId( UniSetTypes::ObjectId backid ) ...@@ -115,7 +115,7 @@ void UniversalInterface::initBackId( UniSetTypes::ObjectId backid )
* \exception IOBadParam - генерируется если указано неправильное имя датчика или секции * \exception IOBadParam - генерируется если указано неправильное имя датчика или секции
* \exception IOTimeOut - генерируется если в течение времени timeout небыл получен ответ * \exception IOTimeOut - генерируется если в течение времени timeout небыл получен ответ
*/ */
long UniversalInterface::getValue( ObjectId name, ObjectId node ) long UInterface::getValue( ObjectId name, ObjectId node )
throw(IO_THROW_EXCEPTIONS) throw(IO_THROW_EXCEPTIONS)
{ {
if ( name == DefaultObjectId ) if ( name == DefaultObjectId )
...@@ -190,14 +190,14 @@ long UniversalInterface::getValue( ObjectId name, ObjectId node ) ...@@ -190,14 +190,14 @@ long UniversalInterface::getValue( ObjectId name, ObjectId node )
throw UniSetTypes::TimeOut(set_err("UI(getValue): TimeOut",name,node)); throw UniSetTypes::TimeOut(set_err("UI(getValue): TimeOut",name,node));
} }
long UniversalInterface::getValue( ObjectId name ) long UInterface::getValue( ObjectId name )
{ {
return getValue(name, uconf->getLocalNode()); return getValue(name, uconf->getLocalNode());
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
void UniversalInterface::setUndefinedState( IOController_i::SensorInfo& si, bool undefined, void UInterface::setUndefinedState( IOController_i::SensorInfo& si, bool undefined,
UniSetTypes::ObjectId sup_id ) UniSetTypes::ObjectId sup_id )
{ {
if( si.id == DefaultObjectId ) if( si.id == DefaultObjectId )
...@@ -277,7 +277,7 @@ void UniversalInterface::setUndefinedState( IOController_i::SensorInfo& si, bool ...@@ -277,7 +277,7 @@ void UniversalInterface::setUndefinedState( IOController_i::SensorInfo& si, bool
* \return текущее значение датчика * \return текущее значение датчика
* \exception IOBadParam - генерируется если указано неправильное имя вывода или секции * \exception IOBadParam - генерируется если указано неправильное имя вывода или секции
*/ */
void UniversalInterface::setValue(ObjectId name, long value, ObjectId node) void UInterface::setValue(ObjectId name, long value, ObjectId node)
throw(IO_THROW_EXCEPTIONS) throw(IO_THROW_EXCEPTIONS)
{ {
if ( name == DefaultObjectId ) if ( name == DefaultObjectId )
...@@ -353,13 +353,13 @@ void UniversalInterface::setValue(ObjectId name, long value, ObjectId node) ...@@ -353,13 +353,13 @@ void UniversalInterface::setValue(ObjectId name, long value, ObjectId node)
throw UniSetTypes::TimeOut(set_err("UI(setValue): Timeout",name,node)); throw UniSetTypes::TimeOut(set_err("UI(setValue): Timeout",name,node));
} }
void UniversalInterface::setValue(ObjectId name, long value) void UInterface::setValue(ObjectId name, long value)
{ {
setValue(name, value, uconf->getLocalNode()); setValue(name, value, uconf->getLocalNode());
} }
void UniversalInterface::setValue( IOController_i::SensorInfo& si, long value, UniSetTypes::ObjectId supplier ) void UInterface::setValue( IOController_i::SensorInfo& si, long value, UniSetTypes::ObjectId supplier )
{ {
ObjectId old = myid; ObjectId old = myid;
try try
...@@ -378,7 +378,7 @@ void UniversalInterface::setValue( IOController_i::SensorInfo& si, long value, U ...@@ -378,7 +378,7 @@ void UniversalInterface::setValue( IOController_i::SensorInfo& si, long value, U
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
// функция не вырабатывает исключий! // функция не вырабатывает исключий!
void UniversalInterface::fastSetValue( IOController_i::SensorInfo& si, long value, UniSetTypes::ObjectId sup_id ) void UInterface::fastSetValue( IOController_i::SensorInfo& si, long value, UniSetTypes::ObjectId sup_id )
{ {
if ( si.id == DefaultObjectId ) if ( si.id == DefaultObjectId )
{ {
...@@ -466,7 +466,7 @@ void UniversalInterface::fastSetValue( IOController_i::SensorInfo& si, long valu ...@@ -466,7 +466,7 @@ void UniversalInterface::fastSetValue( IOController_i::SensorInfo& si, long valu
* \param cmd - команда см. \ref UniversalIO::UIOCommand * \param cmd - команда см. \ref UniversalIO::UIOCommand
* \param backid - обратный адрес (идентификатор заказчика) * \param backid - обратный адрес (идентификатор заказчика)
*/ */
void UniversalInterface::askRemoteSensor( ObjectId name, UniversalIO::UIOCommand cmd, ObjectId node, void UInterface::askRemoteSensor( ObjectId name, UniversalIO::UIOCommand cmd, ObjectId node,
UniSetTypes::ObjectId backid ) throw(IO_THROW_EXCEPTIONS) UniSetTypes::ObjectId backid ) throw(IO_THROW_EXCEPTIONS)
{ {
if( backid==UniSetTypes::DefaultObjectId ) if( backid==UniSetTypes::DefaultObjectId )
...@@ -554,7 +554,7 @@ void UniversalInterface::askRemoteSensor( ObjectId name, UniversalIO::UIOCommand ...@@ -554,7 +554,7 @@ void UniversalInterface::askRemoteSensor( ObjectId name, UniversalIO::UIOCommand
throw UniSetTypes::TimeOut(set_err("UI(askSensor): Timeout",name,node)); throw UniSetTypes::TimeOut(set_err("UI(askSensor): Timeout",name,node));
} }
void UniversalInterface::askSensor( ObjectId name, UniversalIO::UIOCommand cmd, UniSetTypes::ObjectId backid ) void UInterface::askSensor( ObjectId name, UniversalIO::UIOCommand cmd, UniSetTypes::ObjectId backid )
{ {
askRemoteSensor(name, cmd, uconf->getLocalNode(), backid); askRemoteSensor(name, cmd, uconf->getLocalNode(), backid);
} }
...@@ -564,7 +564,7 @@ void UniversalInterface::askSensor( ObjectId name, UniversalIO::UIOCommand cmd, ...@@ -564,7 +564,7 @@ void UniversalInterface::askSensor( ObjectId name, UniversalIO::UIOCommand cmd,
* \param name - идентификатор объекта * \param name - идентификатор объекта
* \param node - идентификатор узла * \param node - идентификатор узла
*/ */
IOType UniversalInterface::getIOType(ObjectId name, ObjectId node) IOType UInterface::getIOType(ObjectId name, ObjectId node)
throw(IO_THROW_EXCEPTIONS) throw(IO_THROW_EXCEPTIONS)
{ {
if ( name == DefaultObjectId ) if ( name == DefaultObjectId )
...@@ -640,7 +640,7 @@ IOType UniversalInterface::getIOType(ObjectId name, ObjectId node) ...@@ -640,7 +640,7 @@ IOType UniversalInterface::getIOType(ObjectId name, ObjectId node)
throw UniSetTypes::TimeOut(set_err("UI(getIOType): Timeout",name, node)); throw UniSetTypes::TimeOut(set_err("UI(getIOType): Timeout",name, node));
} }
IOType UniversalInterface::getIOType(ObjectId name) IOType UInterface::getIOType(ObjectId name)
{ {
return getIOType(name, uconf->getLocalNode() ); return getIOType(name, uconf->getLocalNode() );
} }
...@@ -649,7 +649,7 @@ IOType UniversalInterface::getIOType(ObjectId name) ...@@ -649,7 +649,7 @@ IOType UniversalInterface::getIOType(ObjectId name)
* \param name - идентификатор объекта * \param name - идентификатор объекта
* \param node - идентификатор узла * \param node - идентификатор узла
*/ */
ObjectType UniversalInterface::getType(ObjectId name, ObjectId node) ObjectType UInterface::getType(ObjectId name, ObjectId node)
throw(IO_THROW_EXCEPTIONS) throw(IO_THROW_EXCEPTIONS)
{ {
if ( name == DefaultObjectId ) if ( name == DefaultObjectId )
...@@ -723,20 +723,20 @@ ObjectType UniversalInterface::getType(ObjectId name, ObjectId node) ...@@ -723,20 +723,20 @@ ObjectType UniversalInterface::getType(ObjectId name, ObjectId node)
throw UniSetTypes::TimeOut(set_err("UI(getType): Timeout",name, node)); throw UniSetTypes::TimeOut(set_err("UI(getType): Timeout",name, node));
} }
ObjectType UniversalInterface::getType(ObjectId name) ObjectType UInterface::getType(ObjectId name)
{ {
return getType(name, uconf->getLocalNode()); return getType(name, uconf->getLocalNode());
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
void UniversalInterface::registered(UniSetTypes::ObjectId id, const UniSetTypes::ObjectPtr oRef, bool force) void UInterface::registered(UniSetTypes::ObjectId id, const UniSetTypes::ObjectPtr oRef, bool force)
throw(UniSetTypes::ORepFailed) throw(UniSetTypes::ORepFailed)
{ {
registered(id,uconf->getLocalNode(), oRef,force); registered(id,uconf->getLocalNode(), oRef,force);
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
void UniversalInterface::registered( UniSetTypes::ObjectId id, UniSetTypes::ObjectId node, void UInterface::registered( UniSetTypes::ObjectId id, UniSetTypes::ObjectId node,
const UniSetTypes::ObjectPtr oRef, bool force ) throw(ORepFailed) const UniSetTypes::ObjectPtr oRef, bool force ) throw(ORepFailed)
{ {
// если влючён режим использования локальных файлов // если влючён режим использования локальных файлов
...@@ -761,7 +761,7 @@ void UniversalInterface::registered( UniSetTypes::ObjectId id, UniSetTypes::Obje ...@@ -761,7 +761,7 @@ void UniversalInterface::registered( UniSetTypes::ObjectId id, UniSetTypes::Obje
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
void UniversalInterface::unregister(UniSetTypes::ObjectId id, UniSetTypes::ObjectId node)throw(ORepFailed) void UInterface::unregister(UniSetTypes::ObjectId id, UniSetTypes::ObjectId node)throw(ORepFailed)
{ {
if( uconf->isLocalIOR() ) if( uconf->isLocalIOR() )
{ {
...@@ -780,13 +780,13 @@ void UniversalInterface::unregister(UniSetTypes::ObjectId id, UniSetTypes::Objec ...@@ -780,13 +780,13 @@ void UniversalInterface::unregister(UniSetTypes::ObjectId id, UniSetTypes::Objec
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
void UniversalInterface::unregister(UniSetTypes::ObjectId id)throw(UniSetTypes::ORepFailed) void UInterface::unregister(UniSetTypes::ObjectId id)throw(UniSetTypes::ORepFailed)
{ {
unregister(id,uconf->getLocalNode()); unregister(id,uconf->getLocalNode());
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeoutSec ) ObjectPtr UInterface::resolve( ObjectId rid , ObjectId node, int timeoutSec )
throw(ResolveNameError, UniSetTypes::TimeOut ) throw(ResolveNameError, UniSetTypes::TimeOut )
{ {
if ( rid == DefaultObjectId ) if ( rid == DefaultObjectId )
...@@ -927,7 +927,7 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout ...@@ -927,7 +927,7 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout
// ------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------
string UniversalInterface::timeToString(time_t tm, const std::string brk ) string UInterface::timeToString(time_t tm, const std::string brk )
{ {
struct tm *tms = localtime(&tm); struct tm *tms = localtime(&tm);
ostringstream time; ostringstream time;
...@@ -937,7 +937,7 @@ string UniversalInterface::timeToString(time_t tm, const std::string brk ) ...@@ -937,7 +937,7 @@ string UniversalInterface::timeToString(time_t tm, const std::string brk )
return time.str(); return time.str();
} }
string UniversalInterface::dateToString(time_t tm, const std::string brk ) string UInterface::dateToString(time_t tm, const std::string brk )
{ {
struct tm *tms = localtime(&tm); struct tm *tms = localtime(&tm);
ostringstream date; ostringstream date;
...@@ -949,7 +949,7 @@ string UniversalInterface::dateToString(time_t tm, const std::string brk ) ...@@ -949,7 +949,7 @@ string UniversalInterface::dateToString(time_t tm, const std::string brk )
//-------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------
void UniversalInterface::send( ObjectId name, TransportMessage& msg, ObjectId node) void UInterface::send( ObjectId name, TransportMessage& msg, ObjectId node)
throw(IO_THROW_EXCEPTIONS) throw(IO_THROW_EXCEPTIONS)
{ {
if ( name == DefaultObjectId ) if ( name == DefaultObjectId )
...@@ -1012,13 +1012,13 @@ void UniversalInterface::send( ObjectId name, TransportMessage& msg, ObjectId no ...@@ -1012,13 +1012,13 @@ void UniversalInterface::send( ObjectId name, TransportMessage& msg, ObjectId no
throw UniSetTypes::TimeOut(set_err("UI(send): Timeout",name, node)); throw UniSetTypes::TimeOut(set_err("UI(send): Timeout",name, node));
} }
void UniversalInterface::send( ObjectId name, TransportMessage& msg ) void UInterface::send( ObjectId name, TransportMessage& msg )
{ {
send(name, msg, uconf->getLocalNode()); send(name, msg, uconf->getLocalNode());
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
IOController_i::ShortIOInfo UniversalInterface::getChangedTime( UniSetTypes::ObjectId id, UniSetTypes::ObjectId node ) IOController_i::ShortIOInfo UInterface::getChangedTime( UniSetTypes::ObjectId id, UniSetTypes::ObjectId node )
{ {
if( id == DefaultObjectId ) if( id == DefaultObjectId )
throw ORepFailed("UI(getChangedTime): Unknown id=UniSetTypes::DefaultObjectId"); throw ORepFailed("UI(getChangedTime): Unknown id=UniSetTypes::DefaultObjectId");
...@@ -1096,7 +1096,7 @@ IOController_i::ShortIOInfo UniversalInterface::getChangedTime( UniSetTypes::Obj ...@@ -1096,7 +1096,7 @@ IOController_i::ShortIOInfo UniversalInterface::getChangedTime( UniSetTypes::Obj
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
ObjectPtr UniversalInterface::CacheOfResolve::resolve( ObjectId id, ObjectId node ) ObjectPtr UInterface::CacheOfResolve::resolve( ObjectId id, ObjectId node )
throw(NameNotFound) throw(NameNotFound)
{ {
UniSetTypes::uniset_rwmutex_rlock l(cmutex); UniSetTypes::uniset_rwmutex_rlock l(cmutex);
...@@ -1120,7 +1120,7 @@ ObjectPtr UniversalInterface::CacheOfResolve::resolve( ObjectId id, ObjectId nod ...@@ -1120,7 +1120,7 @@ ObjectPtr UniversalInterface::CacheOfResolve::resolve( ObjectId id, ObjectId nod
throw UniSetTypes::NameNotFound(); throw UniSetTypes::NameNotFound();
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
void UniversalInterface::CacheOfResolve::cache( ObjectId id, ObjectId node, ObjectVar ptr ) void UInterface::CacheOfResolve::cache( ObjectId id, ObjectId node, ObjectVar ptr )
{ {
UniSetTypes::uniset_rwmutex_wrlock l(cmutex); UniSetTypes::uniset_rwmutex_wrlock l(cmutex);
UniSetTypes::KeyType k(key(id,node)); UniSetTypes::KeyType k(key(id,node));
...@@ -1135,7 +1135,7 @@ void UniversalInterface::CacheOfResolve::cache( ObjectId id, ObjectId node, Obje ...@@ -1135,7 +1135,7 @@ void UniversalInterface::CacheOfResolve::cache( ObjectId id, ObjectId node, Obje
} }
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
bool UniversalInterface::CacheOfResolve::clean() bool UInterface::CacheOfResolve::clean()
{ {
UniSetTypes::uniset_rwmutex_wrlock l(cmutex); UniSetTypes::uniset_rwmutex_wrlock l(cmutex);
...@@ -1159,7 +1159,7 @@ bool UniversalInterface::CacheOfResolve::clean() ...@@ -1159,7 +1159,7 @@ bool UniversalInterface::CacheOfResolve::clean()
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
void UniversalInterface::CacheOfResolve::erase( UniSetTypes::ObjectId id, UniSetTypes::ObjectId node ) void UInterface::CacheOfResolve::erase( UniSetTypes::ObjectId id, UniSetTypes::ObjectId node )
{ {
UniSetTypes::uniset_rwmutex_wrlock l(cmutex); UniSetTypes::uniset_rwmutex_wrlock l(cmutex);
//#warning Временно отключён кэш //#warning Временно отключён кэш
...@@ -1171,7 +1171,7 @@ void UniversalInterface::CacheOfResolve::erase( UniSetTypes::ObjectId id, UniSet ...@@ -1171,7 +1171,7 @@ void UniversalInterface::CacheOfResolve::erase( UniSetTypes::ObjectId id, UniSet
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
bool UniversalInterface::isExist( UniSetTypes::ObjectId id ) bool UInterface::isExist( UniSetTypes::ObjectId id )
{ {
try try
{ {
...@@ -1201,7 +1201,7 @@ bool UniversalInterface::isExist( UniSetTypes::ObjectId id ) ...@@ -1201,7 +1201,7 @@ bool UniversalInterface::isExist( UniSetTypes::ObjectId id )
return false; return false;
} }
// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
bool UniversalInterface::isExist( UniSetTypes::ObjectId id, UniSetTypes::ObjectId node ) bool UInterface::isExist( UniSetTypes::ObjectId id, UniSetTypes::ObjectId node )
{ {
if( node==uconf->getLocalNode() ) if( node==uconf->getLocalNode() )
return isExist(id); return isExist(id);
...@@ -1225,7 +1225,7 @@ bool UniversalInterface::isExist( UniSetTypes::ObjectId id, UniSetTypes::ObjectI ...@@ -1225,7 +1225,7 @@ bool UniversalInterface::isExist( UniSetTypes::ObjectId id, UniSetTypes::ObjectI
return false; return false;
} }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
string UniversalInterface::set_err(const string& pre, UniSetTypes::ObjectId id, UniSetTypes::ObjectId node) string UInterface::set_err(const string& pre, UniSetTypes::ObjectId id, UniSetTypes::ObjectId node)
{ {
if( id==UniSetTypes::DefaultObjectId ) if( id==UniSetTypes::DefaultObjectId )
return string(pre+" DefaultObjectId"); return string(pre+" DefaultObjectId");
...@@ -1240,7 +1240,7 @@ string UniversalInterface::set_err(const string& pre, UniSetTypes::ObjectId id, ...@@ -1240,7 +1240,7 @@ string UniversalInterface::set_err(const string& pre, UniSetTypes::ObjectId id,
return s.str(); return s.str();
} }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
void UniversalInterface::askThreshold( UniSetTypes::ObjectId sid, UniSetTypes::ThresholdId tid, void UInterface::askThreshold( UniSetTypes::ObjectId sid, UniSetTypes::ThresholdId tid,
UniversalIO::UIOCommand cmd, UniversalIO::UIOCommand cmd,
CORBA::Long low, CORBA::Long hi, CORBA::Long sb, CORBA::Long low, CORBA::Long hi, CORBA::Long sb,
UniSetTypes::ObjectId backid) UniSetTypes::ObjectId backid)
...@@ -1248,7 +1248,7 @@ void UniversalInterface::askThreshold( UniSetTypes::ObjectId sid, UniSetTypes::T ...@@ -1248,7 +1248,7 @@ void UniversalInterface::askThreshold( UniSetTypes::ObjectId sid, UniSetTypes::T
askRemoteThreshold(sid, uconf->getLocalNode(), tid, cmd, low,hi,sb, backid); askRemoteThreshold(sid, uconf->getLocalNode(), tid, cmd, low,hi,sb, backid);
} }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
void UniversalInterface::askRemoteThreshold( UniSetTypes::ObjectId sid, UniSetTypes::ObjectId node, void UInterface::askRemoteThreshold( UniSetTypes::ObjectId sid, UniSetTypes::ObjectId node,
UniSetTypes::ThresholdId tid, UniversalIO::UIOCommand cmd, UniSetTypes::ThresholdId tid, UniversalIO::UIOCommand cmd,
CORBA::Long lowLimit, CORBA::Long hiLimit, CORBA::Long sensibility, CORBA::Long lowLimit, CORBA::Long hiLimit, CORBA::Long sensibility,
UniSetTypes::ObjectId backid ) UniSetTypes::ObjectId backid )
...@@ -1338,7 +1338,7 @@ void UniversalInterface::askRemoteThreshold( UniSetTypes::ObjectId sid, UniSetTy ...@@ -1338,7 +1338,7 @@ void UniversalInterface::askRemoteThreshold( UniSetTypes::ObjectId sid, UniSetTy
} }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
CORBA::Long UniversalInterface::getRawValue( const IOController_i::SensorInfo& si ) CORBA::Long UInterface::getRawValue( const IOController_i::SensorInfo& si )
{ {
if ( si.id == DefaultObjectId ) if ( si.id == DefaultObjectId )
throw ORepFailed("UI(getRawValue): попытка обратиться к объекту с id=UniSetTypes::DefaultObjectId"); throw ORepFailed("UI(getRawValue): попытка обратиться к объекту с id=UniSetTypes::DefaultObjectId");
...@@ -1409,7 +1409,7 @@ CORBA::Long UniversalInterface::getRawValue( const IOController_i::SensorInfo& s ...@@ -1409,7 +1409,7 @@ CORBA::Long UniversalInterface::getRawValue( const IOController_i::SensorInfo& s
throw UniSetTypes::TimeOut(set_err("UI(getRawValue): Timeout",si.id,si.node)); throw UniSetTypes::TimeOut(set_err("UI(getRawValue): Timeout",si.id,si.node));
} }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
void UniversalInterface::calibrate(const IOController_i::SensorInfo& si, void UInterface::calibrate(const IOController_i::SensorInfo& si,
const IOController_i::CalibrateInfo& ci, const IOController_i::CalibrateInfo& ci,
UniSetTypes::ObjectId admId ) UniSetTypes::ObjectId admId )
{ {
...@@ -1489,7 +1489,7 @@ void UniversalInterface::calibrate(const IOController_i::SensorInfo& si, ...@@ -1489,7 +1489,7 @@ void UniversalInterface::calibrate(const IOController_i::SensorInfo& si,
throw UniSetTypes::TimeOut(set_err("UI(calibrate): Timeout",si.id,si.node)); throw UniSetTypes::TimeOut(set_err("UI(calibrate): Timeout",si.id,si.node));
} }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
IOController_i::CalibrateInfo UniversalInterface::getCalibrateInfo( const IOController_i::SensorInfo& si ) IOController_i::CalibrateInfo UInterface::getCalibrateInfo( const IOController_i::SensorInfo& si )
{ {
if ( si.id == DefaultObjectId ) if ( si.id == DefaultObjectId )
throw ORepFailed("UI(getCalibrateInfo): попытка обратиться к объекту с id=UniSetTypes::DefaultObjectId"); throw ORepFailed("UI(getCalibrateInfo): попытка обратиться к объекту с id=UniSetTypes::DefaultObjectId");
...@@ -1560,7 +1560,7 @@ IOController_i::CalibrateInfo UniversalInterface::getCalibrateInfo( const IOCont ...@@ -1560,7 +1560,7 @@ IOController_i::CalibrateInfo UniversalInterface::getCalibrateInfo( const IOCont
throw UniSetTypes::TimeOut(set_err("UI(getCalibrateInfo): Timeout",si.id,si.node)); throw UniSetTypes::TimeOut(set_err("UI(getCalibrateInfo): Timeout",si.id,si.node));
} }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
IOController_i::SensorInfoSeq_var UniversalInterface::getSensorSeq( UniSetTypes::IDList& lst ) IOController_i::SensorInfoSeq_var UInterface::getSensorSeq( UniSetTypes::IDList& lst )
{ {
if( lst.size() == 0 ) if( lst.size() == 0 )
return IOController_i::SensorInfoSeq_var(); return IOController_i::SensorInfoSeq_var();
...@@ -1639,7 +1639,7 @@ IOController_i::SensorInfoSeq_var UniversalInterface::getSensorSeq( UniSetTypes: ...@@ -1639,7 +1639,7 @@ IOController_i::SensorInfoSeq_var UniversalInterface::getSensorSeq( UniSetTypes:
} }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
IDSeq_var UniversalInterface::setOutputSeq( const IOController_i::OutSeq& lst, UniSetTypes::ObjectId sup_id ) IDSeq_var UInterface::setOutputSeq( const IOController_i::OutSeq& lst, UniSetTypes::ObjectId sup_id )
{ {
if( lst.length() == 0 ) if( lst.length() == 0 )
return UniSetTypes::IDSeq_var(); return UniSetTypes::IDSeq_var();
...@@ -1714,7 +1714,7 @@ IDSeq_var UniversalInterface::setOutputSeq( const IOController_i::OutSeq& lst, U ...@@ -1714,7 +1714,7 @@ IDSeq_var UniversalInterface::setOutputSeq( const IOController_i::OutSeq& lst, U
throw UniSetTypes::TimeOut(set_err("UI(setOutputSeq): Timeout",lst[0].si.id,lst[0].si.node)); throw UniSetTypes::TimeOut(set_err("UI(setOutputSeq): Timeout",lst[0].si.id,lst[0].si.node));
} }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
UniSetTypes::IDSeq_var UniversalInterface::askSensorsSeq( UniSetTypes::IDList& lst, UniSetTypes::IDSeq_var UInterface::askSensorsSeq( UniSetTypes::IDList& lst,
UniversalIO::UIOCommand cmd, UniSetTypes::ObjectId backid ) UniversalIO::UIOCommand cmd, UniSetTypes::ObjectId backid )
{ {
if( lst.size() == 0 ) if( lst.size() == 0 )
...@@ -1803,7 +1803,7 @@ UniSetTypes::IDSeq_var UniversalInterface::askSensorsSeq( UniSetTypes::IDList& l ...@@ -1803,7 +1803,7 @@ UniSetTypes::IDSeq_var UniversalInterface::askSensorsSeq( UniSetTypes::IDList& l
throw UniSetTypes::TimeOut(set_err("UI(askSensorSeq): Timeout",sid,conf->getLocalNode())); throw UniSetTypes::TimeOut(set_err("UI(askSensorSeq): Timeout",sid,conf->getLocalNode()));
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
IOController_i::ShortMapSeq* UniversalInterface::getSensors( UniSetTypes::ObjectId id, UniSetTypes::ObjectId node ) IOController_i::ShortMapSeq* UInterface::getSensors( UniSetTypes::ObjectId id, UniSetTypes::ObjectId node )
{ {
try try
{ {
...@@ -1871,7 +1871,7 @@ IOController_i::ShortMapSeq* UniversalInterface::getSensors( UniSetTypes::Object ...@@ -1871,7 +1871,7 @@ IOController_i::ShortMapSeq* UniversalInterface::getSensors( UniSetTypes::Object
throw UniSetTypes::TimeOut(set_err("UI(getSensors): Timeout",id,node)); throw UniSetTypes::TimeOut(set_err("UI(getSensors): Timeout",id,node));
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
bool UniversalInterface::waitReady( UniSetTypes::ObjectId id, int msec, int pmsec, ObjectId node ) bool UInterface::waitReady( UniSetTypes::ObjectId id, int msec, int pmsec, ObjectId node )
{ {
PassiveTimer ptReady(msec); PassiveTimer ptReady(msec);
bool ready = false; bool ready = false;
...@@ -1891,7 +1891,7 @@ bool UniversalInterface::waitReady( UniSetTypes::ObjectId id, int msec, int pmse ...@@ -1891,7 +1891,7 @@ bool UniversalInterface::waitReady( UniSetTypes::ObjectId id, int msec, int pmse
return ready; return ready;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
bool UniversalInterface::waitWorking( UniSetTypes::ObjectId id, int msec, int pmsec, ObjectId node ) bool UInterface::waitWorking( UniSetTypes::ObjectId id, int msec, int pmsec, ObjectId node )
{ {
PassiveTimer ptReady(msec); PassiveTimer ptReady(msec);
bool ready = false; bool ready = false;
...@@ -1912,7 +1912,7 @@ bool UniversalInterface::waitWorking( UniSetTypes::ObjectId id, int msec, int pm ...@@ -1912,7 +1912,7 @@ bool UniversalInterface::waitWorking( UniSetTypes::ObjectId id, int msec, int pm
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
UniversalIO::IOType UniversalInterface::getConfIOType( UniSetTypes::ObjectId id ) UniversalIO::IOType UInterface::getConfIOType( UniSetTypes::ObjectId id )
{ {
if( !conf ) if( !conf )
return UniversalIO::UnknownIOType; return UniversalIO::UnknownIOType;
......
noinst_LTLIBRARIES = libObjectsRepository.la noinst_LTLIBRARIES = libObjectsRepository.la
libObjectsRepository_la_SOURCES = UniSetTypes_iSK.cc UniSetObject_iSK.cc UniSetTypes.cc \ libObjectsRepository_la_SOURCES = UniSetTypes_iSK.cc UniSetObject_iSK.cc UniSetTypes.cc \
ObjectsManager_iSK.cc ObjectIndex.cc ObjectIndex_Array.cc ObjectIndex_XML.cc ObjectIndex_idXML.cc \ UniSetManager_iSK.cc ObjectIndex.cc ObjectIndex_Array.cc ObjectIndex_XML.cc ObjectIndex_idXML.cc \
ORepHelpers.cc UniSetObject.cc ObjectsManager.cc \ ORepHelpers.cc UniSetObject.cc UniSetManager.cc \
ObjectsActivator.cc ObjectRepository.cc ObjectRepositoryFactory.cc \ UniSetActivator.cc ObjectRepository.cc ObjectRepositoryFactory.cc \
ProxyManager.cc PassiveObject.cc UniSetObject_LT.cc ObjectsManager_LT.cc IORFile.cc ProxyManager.cc PassiveObject.cc UniSetObject_LT.cc UniSetManager_LT.cc IORFile.cc
# ServiceActivator.cc # ServiceActivator.cc
include $(top_builddir)/conf/setting.mk include $(top_builddir)/conf/setting.mk
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include "Exceptions.h" #include "Exceptions.h"
#include "ORepHelpers.h" #include "ORepHelpers.h"
#include "UniversalInterface.h" #include "UInterface.h"
#include "ObjectsActivator.h" #include "UniSetActivator.h"
#include "Debug.h" #include "Debug.h"
#include "Configuration.h" #include "Configuration.h"
...@@ -43,10 +43,10 @@ using namespace std; ...@@ -43,10 +43,10 @@ using namespace std;
Имеется глобальный указатель gActivator (т.к. активатор в системе должен быть только один). Имеется глобальный указатель gActivator (т.к. активатор в системе должен быть только один).
Он заказывает на себя все сигналы связанные с завершением работы. Он заказывает на себя все сигналы связанные с завершением работы.
В качестве обработчика сигналов регистрируется ObjectsActivator::terminated( int signo ). В качестве обработчика сигналов регистрируется UniSetActivator::terminated( int signo ).
В этом обработчике происходит вызов ObjectsActivator::oaDestroy(int signo) для фактического В этом обработчике происходит вызов UniSetActivator::oaDestroy(int signo) для фактического
завершения работы и заказывается сигнал SIG_ALRM на время TERMINATE_TIMEOUT, завершения работы и заказывается сигнал SIG_ALRM на время TERMINATE_TIMEOUT,
c обработчиком ObjectsActivator::finishterm в котором происходит c обработчиком UniSetActivator::finishterm в котором происходит
"надежное" прибивание текущего процесса (raise(SIGKILL)). Это сделано на тот случай, если "надежное" прибивание текущего процесса (raise(SIGKILL)). Это сделано на тот случай, если
в oaDestroy произойдет зависание. в oaDestroy произойдет зависание.
*/ */
...@@ -62,10 +62,10 @@ static UniSetTypes::uniset_mutex signalMutex("Activator::signalMutex"); ...@@ -62,10 +62,10 @@ static UniSetTypes::uniset_mutex signalMutex("Activator::signalMutex");
//static omni_condition pcondx(&pmutex); //static omni_condition pcondx(&pmutex);
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
static ObjectsActivator* gActivator=0; static UniSetActivator* gActivator=0;
//static omni_mutex termutex; //static omni_mutex termutex;
//static omni_condition termcond(&termutex); //static omni_condition termcond(&termutex);
//static ThreadCreator<ObjectsActivator>* termthread=0; //static ThreadCreator<UniSetActivator>* termthread=0;
static int SIGNO; static int SIGNO;
static int MYPID; static int MYPID;
static const int TERMINATE_TIMEOUT = 2; // время отведенное на завершение процесса [сек] static const int TERMINATE_TIMEOUT = 2; // время отведенное на завершение процесса [сек]
...@@ -74,27 +74,27 @@ volatile sig_atomic_t doneterm = 0; ...@@ -74,27 +74,27 @@ volatile sig_atomic_t doneterm = 0;
// PassiveTimer termtmr; // PassiveTimer termtmr;
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
ObjectsActivator::ObjectsActivator( ObjectId id ): UniSetActivator::UniSetActivator( ObjectId id ):
ObjectsManager(id), UniSetManager(id),
orbthr(0), orbthr(0),
omDestroy(false), omDestroy(false),
sig(false) sig(false)
{ {
ObjectsActivator::init(); UniSetActivator::init();
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
ObjectsActivator::ObjectsActivator(): UniSetActivator::UniSetActivator():
ObjectsManager(UniSetTypes::DefaultObjectId), UniSetManager(UniSetTypes::DefaultObjectId),
orbthr(0), orbthr(0),
omDestroy(false), omDestroy(false),
sig(false) sig(false)
{ {
// thread(false); // отключаем поток (раз не задан id) // thread(false); // отключаем поток (раз не задан id)
ObjectsActivator::init(); UniSetActivator::init();
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsActivator::init() void UniSetActivator::init()
{ {
orb = conf->getORB(); orb = conf->getORB();
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
...@@ -107,13 +107,13 @@ void ObjectsActivator::init() ...@@ -107,13 +107,13 @@ void ObjectsActivator::init()
ulog.crit() << myname << "(init): init poa failed!!!" << endl; ulog.crit() << myname << "(init): init poa failed!!!" << endl;
gActivator=this; gActivator=this;
atexit( ObjectsActivator::normalexit ); atexit( UniSetActivator::normalexit );
set_terminate( ObjectsActivator::normalterminate ); // ловушка для неизвестных исключений set_terminate( UniSetActivator::normalterminate ); // ловушка для неизвестных исключений
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
ObjectsActivator::~ObjectsActivator() UniSetActivator::~UniSetActivator()
{ {
if(!procterm ) if(!procterm )
{ {
...@@ -132,7 +132,7 @@ ObjectsActivator::~ObjectsActivator() ...@@ -132,7 +132,7 @@ ObjectsActivator::~ObjectsActivator()
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsActivator::oaDestroy(int signo) void UniSetActivator::oaDestroy(int signo)
{ {
// waittermMutex.lock(); // waittermMutex.lock();
if( !omDestroy ) if( !omDestroy )
...@@ -183,17 +183,17 @@ void ObjectsActivator::oaDestroy(int signo) ...@@ -183,17 +183,17 @@ void ObjectsActivator::oaDestroy(int signo)
* Иначе все ресурсы основного потока передаются для обработки приходящих сообщений (и она не выходит) * Иначе все ресурсы основного потока передаются для обработки приходящих сообщений (и она не выходит)
* *
*/ */
void ObjectsActivator::run(bool thread) void UniSetActivator::run(bool thread)
{ {
if( ulog.is_system() ) if( ulog.is_system() )
ulog.system() << myname << "(run): создаю менеджер "<< endl; ulog.system() << myname << "(run): создаю менеджер "<< endl;
ObjectsManager::initPOA(this); UniSetManager::initPOA(this);
if( getId() == UniSetTypes::DefaultObjectId ) if( getId() == UniSetTypes::DefaultObjectId )
offThread(); // отключение потока обработки сообщений, раз не задан ObjectId offThread(); // отключение потока обработки сообщений, раз не задан ObjectId
ObjectsManager::activate(); // а там вызывается активация всех подчиненных объектов и менеджеров UniSetManager::activate(); // а там вызывается активация всех подчиненных объектов и менеджеров
getinfo(); // заполнение информации об объектах getinfo(); // заполнение информации об объектах
active=true; active=true;
...@@ -207,11 +207,11 @@ void ObjectsActivator::run(bool thread) ...@@ -207,11 +207,11 @@ void ObjectsActivator::run(bool thread)
{ {
if( ulog.is_info() ) if( ulog.is_info() )
ulog.info() << myname << "(run): запускаемся с созданием отдельного потока... "<< endl; ulog.info() << myname << "(run): запускаемся с созданием отдельного потока... "<< endl;
orbthr = new ThreadCreator<ObjectsActivator>(this, &ObjectsActivator::work); orbthr = new ThreadCreator<UniSetActivator>(this, &UniSetActivator::work);
if( !orbthr->start() ) if( !orbthr->start() )
{ {
ulog.crit() << myname << "(run): НЕ СМОГЛИ СОЗДАТЬ ORB-поток"<<endl; ulog.crit() << myname << "(run): НЕ СМОГЛИ СОЗДАТЬ ORB-поток"<<endl;
throw SystemError("(ObjectsActivator::run): CREATE ORB THREAD FAILED"); throw SystemError("(UniSetActivator::run): CREATE ORB THREAD FAILED");
} }
} }
else else
...@@ -226,7 +226,7 @@ void ObjectsActivator::run(bool thread) ...@@ -226,7 +226,7 @@ void ObjectsActivator::run(bool thread)
* Функция останавливает работу orb и завершает поток. А так же удаляет ссылку из репозитория. * Функция останавливает работу orb и завершает поток. А так же удаляет ссылку из репозитория.
* \note Объект становится недоступен другим процессам * \note Объект становится недоступен другим процессам
*/ */
void ObjectsActivator::stop() void UniSetActivator::stop()
{ {
// uniset_mutex_lock l(disactivateMutex, 500); // uniset_mutex_lock l(disactivateMutex, 500);
if( active ) if( active )
...@@ -263,7 +263,7 @@ void ObjectsActivator::stop() ...@@ -263,7 +263,7 @@ void ObjectsActivator::stop()
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsActivator::work() void UniSetActivator::work()
{ {
if( ulog.is_system() ) if( ulog.is_system() )
ulog.system() << myname << "(work): запускаем orb на обработку запросов..."<< endl; ulog.system() << myname << "(work): запускаем orb на обработку запросов..."<< endl;
...@@ -316,9 +316,9 @@ void ObjectsActivator::work() ...@@ -316,9 +316,9 @@ void ObjectsActivator::work()
*/ */
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsActivator::getinfo() void UniSetActivator::getinfo()
{ {
for( ObjectsManagerList::const_iterator it= beginMList(); for( UniSetManagerList::const_iterator it= beginMList();
it!= endMList(); ++it ) it!= endMList(); ++it )
{ {
MInfo mi; MInfo mi;
...@@ -337,7 +337,7 @@ void ObjectsActivator::getinfo() ...@@ -337,7 +337,7 @@ void ObjectsActivator::getinfo()
} }
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsActivator::processingMessage( UniSetTypes::VoidMessage *msg ) void UniSetActivator::processingMessage( UniSetTypes::VoidMessage *msg )
{ {
try try
{ {
...@@ -362,7 +362,7 @@ void ObjectsActivator::processingMessage( UniSetTypes::VoidMessage *msg ) ...@@ -362,7 +362,7 @@ void ObjectsActivator::processingMessage( UniSetTypes::VoidMessage *msg )
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void ObjectsActivator::sysCommand( UniSetTypes::SystemMessage *sm ) void UniSetActivator::sysCommand( UniSetTypes::SystemMessage *sm )
{ {
switch(sm->command) switch(sm->command)
{ {
...@@ -384,14 +384,14 @@ void ObjectsActivator::sysCommand( UniSetTypes::SystemMessage *sm ) ...@@ -384,14 +384,14 @@ void ObjectsActivator::sysCommand( UniSetTypes::SystemMessage *sm )
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
/* /*
void ObjectsActivator::sig_child(int signo) void UniSetActivator::sig_child(int signo)
{ {
ulog.system() << gActivator->getName() << "(sig_child): дочерний процесс закончил работу...(sig=" << signo << ")" << endl; ulog.system() << gActivator->getName() << "(sig_child): дочерний процесс закончил работу...(sig=" << signo << ")" << endl;
while( waitpid(-1, 0, WNOHANG) > 0); while( waitpid(-1, 0, WNOHANG) > 0);
} }
*/ */
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsActivator::set_signals(bool ask) void UniSetActivator::set_signals(bool ask)
{ {
struct sigaction act, oact; struct sigaction act, oact;
...@@ -425,7 +425,7 @@ void ObjectsActivator::set_signals(bool ask) ...@@ -425,7 +425,7 @@ void ObjectsActivator::set_signals(bool ask)
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsActivator::finishterm( int signo ) void UniSetActivator::finishterm( int signo )
{ {
if( !doneterm ) if( !doneterm )
{ {
...@@ -442,7 +442,7 @@ void ObjectsActivator::finishterm( int signo ) ...@@ -442,7 +442,7 @@ void ObjectsActivator::finishterm( int signo )
} }
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsActivator::terminated( int signo ) void UniSetActivator::terminated( int signo )
{ {
if( !signo || doneterm || !gActivator || procterm ) if( !signo || doneterm || !gActivator || procterm )
return; return;
...@@ -463,7 +463,7 @@ void ObjectsActivator::terminated( int signo ) ...@@ -463,7 +463,7 @@ void ObjectsActivator::terminated( int signo )
<< TERMINATE_TIMEOUT << " сек " << endl << flush; << TERMINATE_TIMEOUT << " сек " << endl << flush;
} }
sighold(SIGALRM); sighold(SIGALRM);
sigset(SIGALRM, ObjectsActivator::finishterm); sigset(SIGALRM, UniSetActivator::finishterm);
alarm(TERMINATE_TIMEOUT); alarm(TERMINATE_TIMEOUT);
sigrelse(SIGALRM); sigrelse(SIGALRM);
if( gActivator ) if( gActivator )
...@@ -473,7 +473,7 @@ void ObjectsActivator::terminated( int signo ) ...@@ -473,7 +473,7 @@ void ObjectsActivator::terminated( int signo )
if( ulog.is_system() ) if( ulog.is_system() )
ulog.system() << gActivator->getName() << "(terminated): завершаемся..."<< endl<< flush; ulog.system() << gActivator->getName() << "(terminated): завершаемся..."<< endl<< flush;
if( gActivator ) if( gActivator )
ObjectsActivator::set_signals(false); UniSetActivator::set_signals(false);
sigset(SIGALRM, SIG_DFL); sigset(SIGALRM, SIG_DFL);
raise(SIGNO); raise(SIGNO);
...@@ -482,20 +482,20 @@ void ObjectsActivator::terminated( int signo ) ...@@ -482,20 +482,20 @@ void ObjectsActivator::terminated( int signo )
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsActivator::normalexit() void UniSetActivator::normalexit()
{ {
if( gActivator && ulog.is_system() ) if( gActivator && ulog.is_system() )
ulog.system() << gActivator->getName() << "(default exit): good bye."<< endl << flush; ulog.system() << gActivator->getName() << "(default exit): good bye."<< endl << flush;
} }
void ObjectsActivator::normalterminate() void UniSetActivator::normalterminate()
{ {
if( gActivator ) if( gActivator )
ulog.crit() << gActivator->getName() << "(default exception terminate): Никто не выловил исключение!!! Good bye."<< endl<< flush; ulog.crit() << gActivator->getName() << "(default exception terminate): Никто не выловил исключение!!! Good bye."<< endl<< flush;
// abort(); // abort();
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsActivator::term( int signo ) void UniSetActivator::term( int signo )
{ {
if( ulog.is_system() ) if( ulog.is_system() )
ulog.system() << myname << "(term): TERM" << endl; ulog.system() << myname << "(term): TERM" << endl;
...@@ -525,7 +525,7 @@ void ObjectsActivator::term( int signo ) ...@@ -525,7 +525,7 @@ void ObjectsActivator::term( int signo )
ulog.system() << myname << "(term): END TERM" << endl; ulog.system() << myname << "(term): END TERM" << endl;
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsActivator::waitDestroy() void UniSetActivator::waitDestroy()
{ {
for(;;) for(;;)
{ {
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include "Exceptions.h" #include "Exceptions.h"
#include "ORepHelpers.h" #include "ORepHelpers.h"
#include "UniversalInterface.h" #include "UInterface.h"
#include "ObjectsManager.h" #include "UniSetManager.h"
#include "Debug.h" #include "Debug.h"
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
...@@ -39,11 +39,11 @@ using namespace UniSetTypes; ...@@ -39,11 +39,11 @@ using namespace UniSetTypes;
using namespace std; using namespace std;
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
// объект-функция для посылки сообщения менеджеру // объект-функция для посылки сообщения менеджеру
class MPush: public unary_function<ObjectsManager*, bool> class MPush: public unary_function<UniSetManager*, bool>
{ {
public: public:
MPush(const UniSetTypes::TransportMessage& msg):msg(msg){} MPush(const UniSetTypes::TransportMessage& msg):msg(msg){}
bool operator()(ObjectsManager* m) const bool operator()(UniSetManager* m) const
{ {
try try
{ {
...@@ -79,7 +79,7 @@ class OPush: public unary_function<UniSetObject*, bool> ...@@ -79,7 +79,7 @@ class OPush: public unary_function<UniSetObject*, bool>
}; };
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
ObjectsManager::ObjectsManager(): UniSetManager::UniSetManager():
UniSetObject(UniSetTypes::DefaultObjectId), UniSetObject(UniSetTypes::DefaultObjectId),
sig(0), sig(0),
olistMutex("olistMutex"), olistMutex("olistMutex"),
...@@ -87,7 +87,7 @@ mlistMutex("mlistMutex") ...@@ -87,7 +87,7 @@ mlistMutex("mlistMutex")
{ {
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
ObjectsManager::ObjectsManager( ObjectId id ): UniSetManager::UniSetManager( ObjectId id ):
UniSetObject(id), UniSetObject(id),
sig(0) sig(0)
{ {
...@@ -97,7 +97,7 @@ sig(0) ...@@ -97,7 +97,7 @@ sig(0)
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
ObjectsManager::ObjectsManager(const string& name, const string& section): UniSetManager::UniSetManager(const string& name, const string& section):
UniSetObject(name, section), UniSetObject(name, section),
sig(0) sig(0)
{ {
...@@ -106,7 +106,7 @@ sig(0) ...@@ -106,7 +106,7 @@ sig(0)
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
ObjectsManager::~ObjectsManager() UniSetManager::~UniSetManager()
{ {
try try
{ {
...@@ -122,7 +122,7 @@ ObjectsManager::~ObjectsManager() ...@@ -122,7 +122,7 @@ ObjectsManager::~ObjectsManager()
mlist.clear(); mlist.clear();
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsManager::initPOA( ObjectsManager* rmngr ) void UniSetManager::initPOA( UniSetManager* rmngr )
{ {
if( CORBA::is_nil(pman) ) if( CORBA::is_nil(pman) )
this->pman = rmngr->getPOAManager(); this->pman = rmngr->getPOAManager();
...@@ -145,7 +145,7 @@ void ObjectsManager::initPOA( ObjectsManager* rmngr ) ...@@ -145,7 +145,7 @@ void ObjectsManager::initPOA( ObjectsManager* rmngr )
managers(initial); managers(initial);
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
bool ObjectsManager::addObject( UniSetObject *obj ) bool UniSetManager::addObject( UniSetObject *obj )
{ {
{ //lock { //lock
uniset_rwmutex_wrlock lock(olistMutex); uniset_rwmutex_wrlock lock(olistMutex);
...@@ -161,7 +161,7 @@ bool ObjectsManager::addObject( UniSetObject *obj ) ...@@ -161,7 +161,7 @@ bool ObjectsManager::addObject( UniSetObject *obj )
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
bool ObjectsManager::removeObject(UniSetObject* obj) bool UniSetManager::removeObject(UniSetObject* obj)
{ {
{ //lock { //lock
uniset_rwmutex_wrlock lock(olistMutex); uniset_rwmutex_wrlock lock(olistMutex);
...@@ -206,14 +206,14 @@ bool ObjectsManager::removeObject(UniSetObject* obj) ...@@ -206,14 +206,14 @@ bool ObjectsManager::removeObject(UniSetObject* obj)
/*! /*!
* Функция работы со списком менеджеров * Функция работы со списком менеджеров
*/ */
void ObjectsManager::managers(OManagerCommand cmd) void UniSetManager::managers(OManagerCommand cmd)
{ {
if( ulog.is_info() ) if( ulog.is_info() )
ulog.info() << myname <<"(managers): mlist.size=" ulog.info() << myname <<"(managers): mlist.size="
<< mlist.size() << " cmd=" << cmd << endl; << mlist.size() << " cmd=" << cmd << endl;
{ //lock { //lock
uniset_rwmutex_rlock lock(mlistMutex); uniset_rwmutex_rlock lock(mlistMutex);
for( ObjectsManagerList::iterator li=mlist.begin();li!=mlist.end();++li ) for( UniSetManagerList::iterator li=mlist.begin();li!=mlist.end();++li )
{ {
try try
{ {
...@@ -274,7 +274,7 @@ void ObjectsManager::managers(OManagerCommand cmd) ...@@ -274,7 +274,7 @@ void ObjectsManager::managers(OManagerCommand cmd)
/*! /*!
* Функция работы со списком объектов. * Функция работы со списком объектов.
*/ */
void ObjectsManager::objects(OManagerCommand cmd) void UniSetManager::objects(OManagerCommand cmd)
{ {
if( ulog.is_info() ) if( ulog.is_info() )
ulog.info() << myname <<"(objects): olist.size=" ulog.info() << myname <<"(objects): olist.size="
...@@ -346,7 +346,7 @@ void ObjectsManager::objects(OManagerCommand cmd) ...@@ -346,7 +346,7 @@ void ObjectsManager::objects(OManagerCommand cmd)
* Регистрирация объекта и всех его подобъектов в репозитории. * Регистрирация объекта и всех его подобъектов в репозитории.
* \note Только после этого он (и они) становятся доступны другим процессам * \note Только после этого он (и они) становятся доступны другим процессам
*/ */
bool ObjectsManager::activateObject() bool UniSetManager::activateObject()
{ {
if( ulog.is_info() ) if( ulog.is_info() )
ulog.info() << myname << "(activateObjects): активизирую объекты"<< endl; ulog.info() << myname << "(activateObjects): активизирую объекты"<< endl;
...@@ -360,7 +360,7 @@ bool ObjectsManager::activateObject() ...@@ -360,7 +360,7 @@ bool ObjectsManager::activateObject()
* Удаление объекта и всех его подобъектов из репозитория. * Удаление объекта и всех его подобъектов из репозитория.
* \note Объект становится недоступен другим процессам * \note Объект становится недоступен другим процессам
*/ */
bool ObjectsManager::disactivateObject() bool UniSetManager::disactivateObject()
{ {
if( ulog.is_info() ) if( ulog.is_info() )
ulog.info() << myname << "(disactivateObjects): деактивизирую объекты"<< endl; ulog.info() << myname << "(disactivateObjects): деактивизирую объекты"<< endl;
...@@ -370,9 +370,9 @@ bool ObjectsManager::disactivateObject() ...@@ -370,9 +370,9 @@ bool ObjectsManager::disactivateObject()
return true; return true;
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsManager::sigterm( int signo ) void UniSetManager::sigterm( int signo )
{ {
// ulog.info() << "ObjectsActivator: default processing signo="<< signo << endl; // ulog.info() << "UniSetActivator: default processing signo="<< signo << endl;
sig=signo; sig=signo;
objects(term); objects(term);
managers(term); managers(term);
...@@ -380,7 +380,7 @@ void ObjectsManager::sigterm( int signo ) ...@@ -380,7 +380,7 @@ void ObjectsManager::sigterm( int signo )
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsManager::broadcast(const TransportMessage& msg) void UniSetManager::broadcast(const TransportMessage& msg)
{ {
// себя не забыть... // себя не забыть...
// push(msg); // push(msg);
...@@ -399,13 +399,13 @@ void ObjectsManager::broadcast(const TransportMessage& msg) ...@@ -399,13 +399,13 @@ void ObjectsManager::broadcast(const TransportMessage& msg)
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
bool ObjectsManager::addManager( ObjectsManager *child ) bool UniSetManager::addManager( UniSetManager *child )
{ {
{ //lock { //lock
uniset_rwmutex_wrlock lock(mlistMutex); uniset_rwmutex_wrlock lock(mlistMutex);
// Проверка на совпадение // Проверка на совпадение
ObjectsManagerList::iterator it= find(mlist.begin(),mlist.end(),child); UniSetManagerList::iterator it= find(mlist.begin(),mlist.end(),child);
if(it == mlist.end() ) if(it == mlist.end() )
{ {
mlist.push_back( child ); mlist.push_back( child );
...@@ -420,7 +420,7 @@ bool ObjectsManager::addManager( ObjectsManager *child ) ...@@ -420,7 +420,7 @@ bool ObjectsManager::addManager( ObjectsManager *child )
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
bool ObjectsManager::removeManager( ObjectsManager* child ) bool UniSetManager::removeManager( UniSetManager* child )
{ {
{ //lock { //lock
uniset_rwmutex_wrlock lock(mlistMutex); uniset_rwmutex_wrlock lock(mlistMutex);
...@@ -432,12 +432,12 @@ bool ObjectsManager::removeManager( ObjectsManager* child ) ...@@ -432,12 +432,12 @@ bool ObjectsManager::removeManager( ObjectsManager* child )
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
const ObjectsManager* ObjectsManager::itemM(const ObjectId id) const UniSetManager* UniSetManager::itemM(const ObjectId id)
{ {
{ //lock { //lock
uniset_rwmutex_rlock lock(mlistMutex); uniset_rwmutex_rlock lock(mlistMutex);
for( ObjectsManagerList::iterator li=mlist.begin(); li!=mlist.end();++li ) for( UniSetManagerList::iterator li=mlist.begin(); li!=mlist.end();++li )
{ {
if ( (*li)->getId()==id ) if ( (*li)->getId()==id )
return (*li); return (*li);
...@@ -449,7 +449,7 @@ const ObjectsManager* ObjectsManager::itemM(const ObjectId id) ...@@ -449,7 +449,7 @@ const ObjectsManager* ObjectsManager::itemM(const ObjectId id)
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
const UniSetObject* ObjectsManager::itemO(const ObjectId id) const UniSetObject* UniSetManager::itemO(const ObjectId id)
{ {
{ //lock { //lock
uniset_rwmutex_rlock lock(olistMutex); uniset_rwmutex_rlock lock(olistMutex);
...@@ -465,11 +465,11 @@ const UniSetObject* ObjectsManager::itemO(const ObjectId id) ...@@ -465,11 +465,11 @@ const UniSetObject* ObjectsManager::itemO(const ObjectId id)
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
int ObjectsManager::objectsCount() int UniSetManager::objectsCount()
{ {
int res( olist.size()+mlist.size() ); int res( olist.size()+mlist.size() );
for( ObjectsManagerList::const_iterator it= beginMList(); for( UniSetManagerList::const_iterator it= beginMList();
it!= endMList(); ++it ) it!= endMList(); ++it )
{ {
res+= (*it)->objectsCount(); res+= (*it)->objectsCount();
...@@ -479,7 +479,7 @@ int ObjectsManager::objectsCount() ...@@ -479,7 +479,7 @@ int ObjectsManager::objectsCount()
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
int ObjectsManager::getObjectsInfo( ObjectsManager* mngr, SimpleInfoSeq* seq, int UniSetManager::getObjectsInfo( UniSetManager* mngr, SimpleInfoSeq* seq,
int begin, const long uplimit ) int begin, const long uplimit )
{ {
int ind = begin; int ind = begin;
...@@ -518,7 +518,7 @@ int ObjectsManager::getObjectsInfo( ObjectsManager* mngr, SimpleInfoSeq* seq, ...@@ -518,7 +518,7 @@ int ObjectsManager::getObjectsInfo( ObjectsManager* mngr, SimpleInfoSeq* seq,
return ind; return ind;
// а далее у его менеджеров (рекурсивно) // а далее у его менеджеров (рекурсивно)
for( ObjectsManagerList::const_iterator it=mngr->beginMList(); for( UniSetManagerList::const_iterator it=mngr->beginMList();
it!=mngr->endMList(); ++it ) it!=mngr->endMList(); ++it )
{ {
ind = getObjectsInfo((*it),seq,ind,uplimit); ind = getObjectsInfo((*it),seq,ind,uplimit);
...@@ -530,7 +530,7 @@ int ObjectsManager::getObjectsInfo( ObjectsManager* mngr, SimpleInfoSeq* seq, ...@@ -530,7 +530,7 @@ int ObjectsManager::getObjectsInfo( ObjectsManager* mngr, SimpleInfoSeq* seq,
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
SimpleInfoSeq* ObjectsManager::getObjectsInfo( CORBA::Long maxlength ) SimpleInfoSeq* UniSetManager::getObjectsInfo( CORBA::Long maxlength )
{ {
SimpleInfoSeq* res = new SimpleInfoSeq(); // ЗА ОСВОБОЖДЕНИЕ ПАМЯТИ ОТВЕЧАЕТ КЛИЕНТ!!!!!! SimpleInfoSeq* res = new SimpleInfoSeq(); // ЗА ОСВОБОЖДЕНИЕ ПАМЯТИ ОТВЕЧАЕТ КЛИЕНТ!!!!!!
// поэтому ему лучше пользоваться при получении _var-классом // поэтому ему лучше пользоваться при получении _var-классом
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
*/ */
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include "Exceptions.h" #include "Exceptions.h"
#include "ObjectsManager_LT.h" #include "UniSetManager_LT.h"
#include "Debug.h" #include "Debug.h"
#include "PassiveTimer.h" #include "PassiveTimer.h"
...@@ -30,23 +30,23 @@ ...@@ -30,23 +30,23 @@
using namespace std; using namespace std;
using namespace UniSetTypes; using namespace UniSetTypes;
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
ObjectsManager_LT::ObjectsManager_LT( UniSetTypes::ObjectId id ): UniSetManager_LT::UniSetManager_LT( UniSetTypes::ObjectId id ):
ObjectsManager(id), UniSetManager(id),
sleepTime(UniSetTimer::WaitUpTime) sleepTime(UniSetTimer::WaitUpTime)
{ {
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
ObjectsManager_LT::ObjectsManager_LT(): UniSetManager_LT::UniSetManager_LT():
sleepTime(UniSetTimer::WaitUpTime) sleepTime(UniSetTimer::WaitUpTime)
{ {
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
ObjectsManager_LT::~ObjectsManager_LT() UniSetManager_LT::~UniSetManager_LT()
{ {
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsManager_LT::callback() void UniSetManager_LT::callback()
{ {
// При реализации с использованием waitMessage() каждый раз при вызове askTimer() необходимо // При реализации с использованием waitMessage() каждый раз при вызове askTimer() необходимо
// проверять возвращаемое значение на UniSetTimers::WaitUpTime и вызывать termWaiting(), // проверять возвращаемое значение на UniSetTimers::WaitUpTime и вызывать termWaiting(),
...@@ -65,7 +65,7 @@ void ObjectsManager_LT::callback() ...@@ -65,7 +65,7 @@ void ObjectsManager_LT::callback()
} }
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void ObjectsManager_LT::askTimer( UniSetTypes::TimerId timerid, timeout_t timeMS, short ticks, UniSetTypes::Message::Priority p ) void UniSetManager_LT::askTimer( UniSetTypes::TimerId timerid, timeout_t timeMS, short ticks, UniSetTypes::Message::Priority p )
{ {
// проверяйте возвращаемое значение // проверяйте возвращаемое значение
if( lt.askTimer(timerid, timeMS, ticks, p) != UniSetTimer::WaitUpTime ) if( lt.askTimer(timerid, timeMS, ticks, p) != UniSetTimer::WaitUpTime )
......
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
#include "Exceptions.h" #include "Exceptions.h"
#include "ORepHelpers.h" #include "ORepHelpers.h"
#include "ObjectRepository.h" #include "ObjectRepository.h"
#include "UniversalInterface.h" #include "UInterface.h"
#include "UniSetObject.h" #include "UniSetObject.h"
#include "ObjectsManager.h" #include "UniSetManager.h"
#include "Debug.h" #include "Debug.h"
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
...@@ -170,7 +170,7 @@ void UniSetObject::init_object() ...@@ -170,7 +170,7 @@ void UniSetObject::init_object()
* \param om - указазтель на менджер управляющий объектом * \param om - указазтель на менджер управляющий объектом
* \return Возращает \a true если инициализация прошда успешно, и \a false если нет * \return Возращает \a true если инициализация прошда успешно, и \a false если нет
*/ */
bool UniSetObject::init( ObjectsManager* om ) bool UniSetObject::init( UniSetManager* om )
{ {
if( ulog.is_info() ) if( ulog.is_info() )
ulog.info() << myname << ": init..." << endl; ulog.info() << myname << ": init..." << endl;
...@@ -758,8 +758,8 @@ bool UniSetObject::activate() ...@@ -758,8 +758,8 @@ bool UniSetObject::activate()
{ {
ulog.crit() << myname << "(activate): Не задан ID!!! activate failure..." << endl; ulog.crit() << myname << "(activate): Не задан ID!!! activate failure..." << endl;
// вызываем на случай если она переопределена в дочерних классах // вызываем на случай если она переопределена в дочерних классах
// Например в ObjectsManager, если здесь не вызвать, то не будут инициализированы подчинённые объекты. // Например в UniSetManager, если здесь не вызвать, то не будут инициализированы подчинённые объекты.
// (см. ObjectsManager::activateObject) // (см. UniSetManager::activateObject)
activateObject(); activateObject();
return false; return false;
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
//#include <stream.h> //#include <stream.h>
#include <sstream> #include <sstream>
#include <cmath> #include <cmath>
#include "UniversalInterface.h" #include "UInterface.h"
#include "IOController.h" #include "IOController.h"
#include "Debug.h" #include "Debug.h"
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
...@@ -41,14 +41,14 @@ IOController::IOController(): ...@@ -41,14 +41,14 @@ IOController::IOController():
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
IOController::IOController(const string name, const string section): IOController::IOController(const string name, const string section):
ObjectsManager(name, section), UniSetManager(name, section),
ioMutex(name+"_ioMutex"), ioMutex(name+"_ioMutex"),
isPingDBServer(true) isPingDBServer(true)
{ {
} }
IOController::IOController(ObjectId id): IOController::IOController(ObjectId id):
ObjectsManager(id), UniSetManager(id),
ioMutex(string(conf->oind->getMapName(id))+"_ioMutex"), ioMutex(string(conf->oind->getMapName(id))+"_ioMutex"),
isPingDBServer(true) isPingDBServer(true)
{ {
...@@ -62,7 +62,7 @@ IOController::~IOController() ...@@ -62,7 +62,7 @@ IOController::~IOController()
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
bool IOController::activateObject() bool IOController::activateObject()
{ {
bool res = ObjectsManager::activateObject(); bool res = UniSetManager::activateObject();
sensorsRegistration(); sensorsRegistration();
return res; return res;
} }
...@@ -70,7 +70,7 @@ bool IOController::activateObject() ...@@ -70,7 +70,7 @@ bool IOController::activateObject()
bool IOController::disactivateObject() bool IOController::disactivateObject()
{ {
sensorsUnregistration(); sensorsUnregistration();
return ObjectsManager::disactivateObject(); return UniSetManager::disactivateObject();
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void IOController::sensorsUnregistration() void IOController::sensorsUnregistration()
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include "UniversalInterface.h" #include "UInterface.h"
#include "IONotifyController.h" #include "IONotifyController.h"
#include "Debug.h" #include "Debug.h"
#include "NCRestorer.h" #include "NCRestorer.h"
......
...@@ -127,7 +127,7 @@ void SMonitor::sysCommand( SystemMessage *sm ) ...@@ -127,7 +127,7 @@ void SMonitor::sysCommand( SystemMessage *sm )
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void SMonitor::sensorInfo( SensorMessage *si ) void SMonitor::sensorInfo( SensorMessage *si )
{ {
cout << "(" << setw(6) << si->id << "): " << setw(8) << UniversalInterface::timeToString(si->sm_tv_sec,":") cout << "(" << setw(6) << si->id << "): " << setw(8) << UInterface::timeToString(si->sm_tv_sec,":")
<< "(" << setw(6) << si->sm_tv_usec << "): "; << "(" << setw(6) << si->sm_tv_usec << "): ";
cout << setw(45) << conf->oind->getMapName(si->id); cout << setw(45) << conf->oind->getMapName(si->id);
cout << "\tvalue=" << si->value << "\tfvalue=" << ( (float)si->value / pow(10.0,si->ci.precision) ) << endl; cout << "\tvalue=" << si->value << "\tfvalue=" << ( (float)si->value / pow(10.0,si->ci.precision) ) << endl;
......
#include <time.h>
#include "Debug.h"
#include "UniSetTypes.h"
using namespace std;
using namespace UniSetTypes;
int main( int argc, const char **argv )
{
DebugStream tlog;
tlog.addLevel(Debug::ANY);
tlog[Debug::INFO] << ": [info] ..." << endl;
tlog(Debug::INFO) << ": (info) ..." << endl;
cout << endl;
tlog.d_level1() << ": (level1) ..." << endl;
tlog.level1() << ": [level1] ..." << endl;
tlog.info() << ": [info] ..." << endl;
if( tlog.is_level1() )
tlog.d_level1() << ": is level1..." << endl;
return 0;
}
#include <time.h> #include <time.h>
#include "UniversalInterface.h" #include "UInterface.h"
#include "UniSetTypes.h" #include "UniSetTypes.h"
using namespace std; using namespace std;
...@@ -10,7 +10,7 @@ int main( int argc, const char **argv ) ...@@ -10,7 +10,7 @@ int main( int argc, const char **argv )
try try
{ {
uniset_init(argc,argv,"test.xml"); uniset_init(argc,argv,"test.xml");
UniversalInterface ui; UInterface ui;
cout << "** check getSensorID function **" << endl; cout << "** check getSensorID function **" << endl;
ObjectId id1 = conf->getSensorID("Input1_S"); ObjectId id1 = conf->getSensorID("Input1_S");
......
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