UniSet  2.6.0
DBServer.h
00001 /*
00002  * Copyright (c) 2015 Pavel Vainerman.
00003  *
00004  * This program is free software: you can redistribute it and/or modify
00005  * it under the terms of the GNU Lesser General Public License as
00006  * published by the Free Software Foundation, version 2.1.
00007  *
00008  * This program is distributed in the hope that it will be useful, but
00009  * WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00011  * Lesser General Lesser Public License for more details.
00012  *
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00015  */
00016 // --------------------------------------------------------------------------
00020 // --------------------------------------------------------------------------
00021 #ifndef DBServer_H_
00022 #define DBServer_H_
00023 // --------------------------------------------------------------------------
00024 #include "UniSetTypes.h"
00025 #include "UniSetObject.h"
00026 #include "LogServer.h"
00027 #include "DebugStream.h"
00028 #include "LogAgregator.h"
00029 //------------------------------------------------------------------------------------------
00030 namespace uniset
00031 {
00051 class DBServer:
00052     public UniSetObject
00053 {
00054     public:
00055         DBServer( uniset::ObjectId id, const std::string& prefix = "db" );
00056         DBServer( const std::string& prefix = "db" );
00057         ~DBServer();
00058 
00059         static std::string help_print();
00060 
00061     protected:
00062 
00063         virtual void processingMessage( const uniset::VoidMessage* msg ) override;
00064         virtual void sysCommand( const uniset::SystemMessage* sm ) override;
00065         virtual void confirmInfo( const uniset::ConfirmMessage* cmsg ) {}
00066 
00067         virtual bool activateObject() override;
00068         virtual void initDBServer() {};
00069 
00070 
00071         std::shared_ptr<LogAgregator> loga;
00072         std::shared_ptr<DebugStream> dblog;
00073         std::shared_ptr<LogServer> logserv;
00074         std::string logserv_host = {""};
00075         int logserv_port = {0};
00076 
00077         const std::string prefix = { "db" };
00078 
00079     private:
00080 };
00081 // -------------------------------------------------------------------------
00082 } // end of uniset namespace
00083 //------------------------------------------------------------------------------------------
00084 #endif