code format
This commit is contained in:
@@ -1,37 +1,37 @@
|
||||
/*
|
||||
CD Utils - Control-Debug utilites
|
||||
CD Utils - Control-Debug utilites
|
||||
|
||||
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CDUTILS_CORE_H
|
||||
#define CDUTILS_CORE_H
|
||||
|
||||
#include "cdutils_types.h"
|
||||
#include "cd_core_export.h"
|
||||
#include "cdutils_protocol.h"
|
||||
#include "cdutils_types.h"
|
||||
#include "piconnection.h"
|
||||
#include "pidatatransfer.h"
|
||||
#include "cd_core_export.h"
|
||||
|
||||
|
||||
namespace CDUtils {
|
||||
|
||||
class CDCore;
|
||||
|
||||
typedef void (*Handler)(void*);
|
||||
typedef void (*Handler)(void *);
|
||||
|
||||
class CD_CORE_EXPORT __Core_Initializer__ {
|
||||
public:
|
||||
@@ -42,13 +42,13 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class CD_CORE_EXPORT CDCore: public PIObject
|
||||
{
|
||||
class CD_CORE_EXPORT CDCore: public PIObject {
|
||||
PIOBJECT(CDUtils::CDCore);
|
||||
friend class __Core_Initializer__;
|
||||
friend class CDSection;
|
||||
friend class Interface;
|
||||
friend class XInterface;
|
||||
|
||||
public:
|
||||
static CDCore * instance();
|
||||
static bool destroy();
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
EVENT(X_Received);
|
||||
EVENT(X_ReceiveFail);
|
||||
EVENT(X_ChangedGlobal);
|
||||
EVENT1(X_ReceivedX, PIVector<PIDeque<int> >, pathes);
|
||||
EVENT1(X_ReceivedX, PIVector<PIDeque<int>>, pathes);
|
||||
|
||||
EVENT(C_Sended);
|
||||
EVENT(C_SendFail);
|
||||
@@ -80,12 +80,12 @@ public:
|
||||
EVENT(M_ChangedGlobal);
|
||||
EVENT3(M_Message, PIDeque<int>, path, int, type, PIString, msg);
|
||||
|
||||
void cd_write (CDSection * cd, PIIODevice * d);
|
||||
void cd_read (CDSection * cd, PIIODevice * d);
|
||||
void cd_parse (CDSection * cd, PIIODevice * d);
|
||||
void cd_update (CDSection * cd, PIIODevice * d, UpdateModeFlags mode);
|
||||
void cd_write(CDSection * cd, PIIODevice * d);
|
||||
void cd_read(CDSection * cd, PIIODevice * d);
|
||||
void cd_parse(CDSection * cd, PIIODevice * d);
|
||||
void cd_update(CDSection * cd, PIIODevice * d, UpdateModeFlags mode);
|
||||
void cd_calculate(CDSection * cd);
|
||||
void cd_send (CDSection * cd, CDPacketType pt, bool direct = false);
|
||||
void cd_send(CDSection * cd, CDPacketType pt, bool direct = false);
|
||||
void send(CDType::cdT cdt);
|
||||
void request(CDType::cdT cdt);
|
||||
void initApp();
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
void stopX();
|
||||
void sendCommand(const CDType & c);
|
||||
void registerCHandler(const CDType & c, PIObject * o, Handler h);
|
||||
bool inProgress() {return sendt.isRunning();}
|
||||
bool inProgress() { return sendt.isRunning(); }
|
||||
void sendMessage(const CDType & m, MessageType mt, const PIString & msg);
|
||||
|
||||
CDSection * root(CDType::cdT cdt);
|
||||
@@ -105,8 +105,8 @@ public:
|
||||
static PIString pathToString(const PIDeque<int> & p);
|
||||
static PIDeque<int> stringToPath(const PIString & p);
|
||||
|
||||
static PIString pultConfig() {return PIString(pult_config);}
|
||||
static PIString appConfig() {return PIString(app_config);}
|
||||
static PIString pultConfig() { return PIString(pult_config); }
|
||||
static PIString appConfig() { return PIString(app_config); }
|
||||
|
||||
private:
|
||||
CDCore();
|
||||
@@ -116,7 +116,7 @@ private:
|
||||
EVENT_HANDLER1(void, dtReceiveFinished, bool, ok);
|
||||
EVENT_HANDLER(void, sendThread);
|
||||
EVENT_HANDLER(void, xTimerTick);
|
||||
EVENT_HANDLER2(void, piCoutFinished, int, id, PIString*, buffer);
|
||||
EVENT_HANDLER2(void, piCoutFinished, int, id, PIString *, buffer);
|
||||
void initRoot(CDSection * r);
|
||||
PIByteArray makeHeader(CDPacketType type, int session_id = 0) const;
|
||||
void sendDirect(PIByteArray & ba);
|
||||
@@ -124,7 +124,7 @@ private:
|
||||
void procReceivedPacket(PIByteArray & ba);
|
||||
void raiseChangedGlobal(CDType::cdT cdt);
|
||||
|
||||
typedef PIPair<PIObject * , Handler> OHPair;
|
||||
typedef PIPair<PIObject *, Handler> OHPair;
|
||||
|
||||
static const char app_config[], pult_config[];
|
||||
PIConnection connection;
|
||||
@@ -134,15 +134,14 @@ private:
|
||||
PITimer x_timer;
|
||||
CDSection k_, x_, c_, m_;
|
||||
PIMutex x_mutex;
|
||||
PIVector<PIDeque<int> > x_selected;
|
||||
PIVector<PIDeque<int>> x_selected;
|
||||
PIMap<PIString, OHPair> c_handlers;
|
||||
bool need_rebuild_x, x_pult_side;
|
||||
|
||||
};
|
||||
|
||||
|
||||
static __Core_Initializer__ __Core_initializer__;
|
||||
|
||||
}
|
||||
} // namespace CDUtils
|
||||
|
||||
#endif // CDUTILS_CORE_H
|
||||
|
||||
Reference in New Issue
Block a user