UniSet  2.24.2
DBServer.h
1 /*
2  * Copyright (c) 2015 Pavel Vainerman.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as
6  * published by the Free Software Foundation, version 2.1.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Lesser Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 // --------------------------------------------------------------------------
20 // --------------------------------------------------------------------------
21 #ifndef DBServer_H_
22 #define DBServer_H_
23 // --------------------------------------------------------------------------
24 #include "UniSetTypes.h"
25 #include "UniSetObject.h"
26 #include "LogServer.h"
27 #include "DebugStream.h"
28 #include "LogAgregator.h"
29 //------------------------------------------------------------------------------------------
30 namespace uniset
31 {
43  class DBServer:
44  public UniSetObject
45  {
46  public:
47  DBServer( uniset::ObjectId id, const std::string& prefix = "db" );
48  DBServer( const std::string& prefix = "db" );
49  ~DBServer();
50 
51  static std::string help_print();
52 
53  virtual uniset::SimpleInfo* getInfo( const char* userparam = "" ) override;
54 
55  protected:
56 
57  virtual void processingMessage( const uniset::VoidMessage* msg ) override;
58  virtual void sysCommand( const uniset::SystemMessage* sm ) override;
59  virtual void confirmInfo( const uniset::ConfirmMessage* cmsg ) {}
60 
61  virtual bool activateObject() override;
62  virtual void initDBServer() {}
63  virtual std::string getMonitInfo( const std::string& params )
64  {
65  return "";
66  }
67 
68 
69  std::shared_ptr<LogAgregator> loga;
70  std::shared_ptr<DebugStream> dblog;
71  std::shared_ptr<LogServer> logserv;
72  std::string logserv_host = {""};
73  int logserv_port = {0};
74  const std::string prefix = { "db" };
75 
76  private:
77  };
78  // -------------------------------------------------------------------------
79 } // end of uniset namespace
80 //------------------------------------------------------------------------------------------
81 #endif
Definition: MessageType.h:237
Definition: DBServer.h:45
virtual bool activateObject() override
Активизация объекта (переопределяется для необходимых действий после активизации)
Definition: DBServer.cc:103
virtual void processingMessage(const uniset::VoidMessage *msg) override
Definition: DBServer.cc:88
Definition: MessageType.h:171
Definition: UniSetObject.h:80
Definition: MessageType.h:91
Definition: CommonEventLoop.h:15
long ObjectId
Definition: UniSetTypes_i.idl:30
Definition: UniSetTypes_i.idl:65