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"
#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
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
......
...@@ -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