-
Notifications
You must be signed in to change notification settings - Fork 13
/
Rifle.h
38 lines (36 loc) · 1.05 KB
/
Rifle.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include <vector>
#include <string>
#include "CZMQToolkit.h"
#define SIZE_OF_STAKE_BUNDLE 500
struct _zctx_t;
typedef struct _zctx_t zctx_t;
class Rifle {
public:
explicit Rifle(const std::string& location);
bool Aim();
std::string GetBinding() const;
bool Fire(const std::string& bullet, const int waitToFire = 10000);
bool FireStake(const void* stake,const int waitToFire = 10000);
bool FireStakes(const std::vector<std::pair<void*, unsigned int> >& stakes,
const int waitToFire = 10000);
bool FireZeroCopy( std::string* zero, const size_t size, void (*FreeFunction)(void*,void*), const int waitToFire = 10000);
int GetHighWater();
void SetHighWater(const int hwm);
int GetIOThreads();
void SetIOThreads(const int count);
void SetOwnSocket(const bool own);
bool GetOwnSocket();
virtual ~Rifle();
protected:
void Destroy();
private:
void setIpcFilePermissions();
std::string mLocation;
int mHwm;
void* mChamber;
zctx_t* mContext;
int mLinger;
int mIOThredCount;
bool mOwnSocket;
};