UniSet  2.6.0
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 {
51  class DBServer:
52  public UniSetObject
53  {
54  public:
55  DBServer( uniset::ObjectId id, const std::string& prefix = "db" );
56  DBServer( const std::string& prefix = "db" );
57  ~DBServer();
58 
59  static std::string help_print();
60 
61  protected:
62 
63  virtual void processingMessage( const uniset::VoidMessage* msg ) override;
64  virtual void sysCommand( const uniset::SystemMessage* sm ) override;
65  virtual void confirmInfo( const uniset::ConfirmMessage* cmsg ) {}
66 
67  virtual bool activateObject() override;
68  virtual void initDBServer() {};
69 
70 
71  std::shared_ptr<LogAgregator> loga;
72  std::shared_ptr<DebugStream> dblog;
73  std::shared_ptr<LogServer> logserv;
74  std::string logserv_host = {""};
75  int logserv_port = {0};
76 
77  const std::string prefix = { "db" };
78 
79  private:
80  };
81  // -------------------------------------------------------------------------
82 } // end of uniset namespace
83 //------------------------------------------------------------------------------------------
84 #endif