Skip to content

Commit

Permalink
add interface
Browse files Browse the repository at this point in the history
  • Loading branch information
prog.chen committed Oct 8, 2014
1 parent cfb2c61 commit 3f8d4dc
Show file tree
Hide file tree
Showing 8 changed files with 34,711 additions and 0 deletions.
22,354 changes: 22,354 additions & 0 deletions interface/acd/bidl/acd.cpp

Large diffs are not rendered by default.

5,169 changes: 5,169 additions & 0 deletions interface/acd/bidl/acd.h

Large diffs are not rendered by default.

1,420 changes: 1,420 additions & 0 deletions interface/acd/bidl/acdcallback.cpp

Large diffs are not rendered by default.

402 changes: 402 additions & 0 deletions interface/acd/bidl/acdcallback.h

Large diffs are not rendered by default.

3,206 changes: 3,206 additions & 0 deletions interface/acd/bidl/acdcommon.cpp

Large diffs are not rendered by default.

775 changes: 775 additions & 0 deletions interface/acd/bidl/acdcommon.h

Large diffs are not rendered by default.

1,117 changes: 1,117 additions & 0 deletions interface/ap/bidl/ap.cpp

Large diffs are not rendered by default.

268 changes: 268 additions & 0 deletions interface/ap/bidl/ap.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
#ifndef _BIDL2SL_AP_H_
#define _BIDL2SL_AP_H_

#include <string>
#include <vector>
#include <set>
#include <map>
#include <bgcc.h>

#include "acdcommon.h"
namespace ap {
class ApAgentInfo {
public:
ApAgentInfo();
~ApAgentInfo();

std::string agentId;
std::string agentDn;
std::string agentPwd;
acd::StatusChangeT statusChangetype;
bool autoAnswer;
bool fcSignin;
std::string skills;
std::string proxyname;
std::string proxyname_old;
int64_t handle;
int32_t flag;

bool operator==(const ApAgentInfo& rhs) const;
bool operator!=(const ApAgentInfo& rhs) const;
bool operator< (const ApAgentInfo& rhs) const;
int32_t read(char *request, int32_t request_len, bgcc::SharedPointer<bgcc::IProtocol> proto);
int32_t write(bgcc::SharedPointer<bgcc::IProtocol> proto) const;
};

typedef std::vector<ApAgentInfo> ApAgentInfoListT;
class apapi : public bgcc::Shareable {
public:
virtual ~apapi() { }

virtual bool ReLoadConfig(
const std::map<std::string, std::string>& ctx) = 0;

virtual bool GetAgents(
ApAgentInfoListT & agentInfoList,
const std::map<std::string, std::string>& ctx) = 0;

};

class apapi_ReLoadConfig_args {
public:
apapi_ReLoadConfig_args();
virtual ~apapi_ReLoadConfig_args();

bool operator==(const apapi_ReLoadConfig_args& rhs) const;
bool operator!=(const apapi_ReLoadConfig_args& rhs) const;
bool operator< (const apapi_ReLoadConfig_args& rhs) const;
int32_t read(char* request, int32_t request_len, bgcc::SharedPointer<bgcc::IProtocol> proto);
};

class apapi_GetAgents_args {
public:
apapi_GetAgents_args();
virtual ~apapi_GetAgents_args();


bool operator==(const apapi_GetAgents_args& rhs) const;
bool operator!=(const apapi_GetAgents_args& rhs) const;
bool operator< (const apapi_GetAgents_args& rhs) const;
int32_t read(char* request, int32_t request_len, bgcc::SharedPointer<bgcc::IProtocol> proto);
};

class apapi_ReLoadConfig_pargs {
public:
virtual ~apapi_ReLoadConfig_pargs();

int32_t write(bgcc::SharedPointer<bgcc::IProtocol> proto) const;
};

class apapi_GetAgents_pargs {
public:
virtual ~apapi_GetAgents_pargs();


int32_t write(bgcc::SharedPointer<bgcc::IProtocol> proto) const;
};

class apapi_ReLoadConfig_result {
public:
apapi_ReLoadConfig_result();
virtual ~apapi_ReLoadConfig_result();

bool return_value;
bool operator==(const apapi_ReLoadConfig_result& rhs) const;
bool operator!=(const apapi_ReLoadConfig_result& rhs) const;
bool operator< (const apapi_ReLoadConfig_result& rhs) const;
int32_t write(bgcc::SharedPointer<bgcc::IProtocol> proto) const;
};

class apapi_GetAgents_result {
public:
apapi_GetAgents_result();
virtual ~apapi_GetAgents_result();

bool return_value;
ApAgentInfoListT agentInfoList;

bool operator==(const apapi_GetAgents_result& rhs) const;
bool operator!=(const apapi_GetAgents_result& rhs) const;
bool operator< (const apapi_GetAgents_result& rhs) const;
int32_t write(bgcc::SharedPointer<bgcc::IProtocol> proto) const;
};

class apapi_ReLoadConfig_presult {
public:
virtual ~apapi_ReLoadConfig_presult();

bool* return_value;
int32_t read(char *request, int32_t request_len, bgcc::SharedPointer<bgcc::IProtocol> proto) const;
};

class apapi_GetAgents_presult {
public:
virtual ~apapi_GetAgents_presult();

bool* return_value;
ApAgentInfoListT* agentInfoList;

int32_t read(char *request, int32_t request_len, bgcc::SharedPointer<bgcc::IProtocol> proto) const;
};

class apapiProxy : public bgcc::BaseProxy {
public:
apapiProxy(
bgcc::ServerInfo serverinfo,
int32_t maxConn,
bgcc::ServiceManager* mgr = NULL,
int32_t tryCount = 5,
int32_t tryInterval = 500);

apapiProxy(
bgcc::ServerInfo serverinfo,
bgcc::ServiceManager* mgr = NULL,
int32_t tryCount = 5,
int32_t tryInterval = 500);

apapiProxy(
const std::string& proxy_name,
int32_t tryCount = 5,
int32_t tryInterval = 500);

bool ReLoadConfig(
bool last = false);

bool GetAgents(
ApAgentInfoListT& agentInfoList,
bool last = false);

private:
void send_ReLoadConfig(
int32_t seqid,
bgcc::SharedPointer<bgcc::ConnInfo> conn);

bool recv_ReLoadConfig(
bgcc::SharedPointer<bgcc::ConnInfo> conn);

void send_GetAgents(
int32_t seqid,
bgcc::SharedPointer<bgcc::ConnInfo> conn);

bool recv_GetAgents(
ApAgentInfoListT& agentInfoList,
bgcc::SharedPointer<bgcc::ConnInfo> conn);

};

class SSLapapiProxy : public bgcc::SSLBaseProxy {
public:
SSLapapiProxy(
bgcc::ServerInfo serverinfo,
int32_t maxConn,
bgcc::ServiceManager* mgr = NULL,
int32_t tryCount = 5,
int32_t tryInterval = 500);

SSLapapiProxy(
bgcc::ServerInfo serverinfo,
bgcc::ServiceManager* mgr = NULL,
int32_t tryCount = 5,
int32_t tryInterval = 500);

SSLapapiProxy(
const std::string& proxy_name,
int32_t tryCount = 5,
int32_t tryInterval = 500);

bool ReLoadConfig(
bool last = false);

bool GetAgents(
ApAgentInfoListT& agentInfoList,
bool last = false);

private:
void send_ReLoadConfig(
int32_t seqid,
bgcc::SharedPointer<bgcc::ConnInfo> conn);

bool recv_ReLoadConfig(
bgcc::SharedPointer<bgcc::ConnInfo> conn);

void send_GetAgents(
int32_t seqid,
bgcc::SharedPointer<bgcc::ConnInfo> conn);

bool recv_GetAgents(
ApAgentInfoListT& agentInfoList,
bgcc::SharedPointer<bgcc::ConnInfo> conn);

};

class apapiProcessor : public bgcc::BaseProcessor {
public:
apapiProcessor(bgcc::SharedPointer<apapi> intf);

virtual ~apapiProcessor(){ }

virtual int32_t process(
char* request,
int32_t request_len,
bgcc::SharedPointer<bgcc::IProtocol> proto);

virtual std::string get_name() const;

protected:
virtual int32_t do_function__(
char* request,
int32_t request_len,
bgcc::SharedPointer<bgcc::IProtocol> proto,
const std::string& fname, int32_t seqid);

bgcc::SharedPointer<apapi> __intf;

private:
int32_t do_ReLoadConfig(
char* request,
int32_t request_len,
bgcc::SharedPointer<bgcc::IProtocol> proto,
int32_t seqid);

int32_t do_GetAgents(
char* request,
int32_t request_len,
bgcc::SharedPointer<bgcc::IProtocol> proto,
int32_t seqid);

typedef int32_t (apapiProcessor::* do_function_ptr)(
char* request,
int32_t request_len,
bgcc::SharedPointer<bgcc::IProtocol> proto,
int32_t seqid);

std::map<std::string, do_function_ptr> __fun_map;
};
}


#endif

0 comments on commit 3f8d4dc

Please sign in to comment.