|
@ -7,9 +7,19 @@ |
|
|
#include "../../../src/pEpLog.hh" |
|
|
#include "../../../src/pEpLog.hh" |
|
|
#include "../../framework/utils.hh" |
|
|
#include "../../framework/utils.hh" |
|
|
#include "PityModel.hh" |
|
|
#include "PityModel.hh" |
|
|
|
|
|
#include <map> |
|
|
|
|
|
|
|
|
namespace pEp { |
|
|
namespace pEp { |
|
|
namespace PityTest11 { |
|
|
namespace PityTest11 { |
|
|
|
|
|
|
|
|
|
|
|
// Group
|
|
|
|
|
|
struct Group { |
|
|
|
|
|
std::string addr; |
|
|
|
|
|
std::string moderator; |
|
|
|
|
|
std::vector<TestIdent> members; |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
class PityPerspective { |
|
|
class PityPerspective { |
|
|
public: |
|
|
public: |
|
|
// Constructors
|
|
|
// Constructors
|
|
@ -18,16 +28,20 @@ namespace pEp { |
|
|
// Lets grant access to the whole model too
|
|
|
// Lets grant access to the whole model too
|
|
|
const PityModel& model; |
|
|
const PityModel& model; |
|
|
|
|
|
|
|
|
|
|
|
TestIdent* getPeer(const std::string& addr); |
|
|
// Perspective
|
|
|
// Perspective
|
|
|
std::string own_name; |
|
|
std::string own_name; |
|
|
std::string cpt_name; |
|
|
// TestIdent* cpt = nullptr;
|
|
|
std::vector<std::string> peers; |
|
|
void setPeerNrAsCpt(int nr); |
|
|
|
|
|
TestIdent& getCpt(); |
|
|
|
|
|
std::vector<TestIdent> peers; |
|
|
|
|
|
|
|
|
Test::Utils::pEpIdent own_ident; |
|
|
Test::Utils::pEpIdent own_ident; |
|
|
Test::Utils::pEpIdent cpt_ident; |
|
|
// Test::Utils::pEpIdent cpt_ident;
|
|
|
|
|
|
|
|
|
// Groups
|
|
|
// Groups
|
|
|
std::vector<Test::Utils::Group> own_groups; |
|
|
Group* getGroup(const std::string& addr); |
|
|
|
|
|
std::vector<Group> groups; |
|
|
|
|
|
|
|
|
//Callbacks
|
|
|
//Callbacks
|
|
|
//internal logging
|
|
|
//internal logging
|
|
@ -35,6 +49,7 @@ namespace pEp { |
|
|
Adapter::pEpLog::pEpLogger logger_debug{ "PityNode", debug_log_enabled }; |
|
|
Adapter::pEpLog::pEpLogger logger_debug{ "PityNode", debug_log_enabled }; |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
|
|
|
int peerNrAsCpt; |
|
|
//internal logging
|
|
|
//internal logging
|
|
|
Adapter::pEpLog::pEpLogger& m4gic_logger_n4me = logger_debug; |
|
|
Adapter::pEpLog::pEpLogger& m4gic_logger_n4me = logger_debug; |
|
|
}; |
|
|
}; |
|
|