31 #if defined(__cplusplus) && !defined(LCB_NO_DEPR_CXX_CTORS)
37 #define LCB_DEPR_CTORS_GET \
38 lcb_get_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
39 lcb_get_cmd_st(const void *key, lcb_size_t nkey=0, lcb_time_t exptime=0, int lock=0) { \
42 if (key != NULL && nkey == 0) { \
43 v.v0.nkey = std::strlen((const char *)key); \
47 v.v0.exptime = exptime; v.v0.lock = lock; v.v0.hashkey = NULL; v.v0.nhashkey = 0; \
51 #define LCB_DEPR_CTORS_RGET \
52 lcb_get_replica_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
53 lcb_get_replica_cmd_st(const void *key, lcb_size_t nkey, lcb_replica_t strategy=LCB_REPLICA_FIRST, int index=0) { \
54 version = 1; v.v1.key = key; v.v1.nkey = nkey; v.v1.hashkey = NULL; v.v1.nhashkey = 0; v.v1.strategy = strategy; v.v1.index = index; \
57 #define LCB_DEPR_CTORS_UNL \
58 lcb_unlock_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
59 lcb_unlock_cmd_st(const void *key, lcb_size_t nkey, lcb_cas_t cas) { \
60 version = 0; v.v0.key = key; v.v0.nkey = nkey; v.v0.cas = cas; v.v0.hashkey = NULL; v.v0.nhashkey = 0; \
63 #define LCB_DEPR_CTORS_STORE \
64 lcb_store_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
65 lcb_store_cmd_st(lcb_storage_t operation, const void *key, lcb_size_t nkey, \
66 const void *bytes=NULL, lcb_size_t nbytes=0, lcb_uint32_t flags=0, \
67 lcb_time_t exptime=0, lcb_cas_t cas=0, lcb_datatype_t datatype=0) { \
68 version = 0; v.v0.operation = operation; v.v0.key = key; v.v0.nkey = nkey; v.v0.cas = cas; \
69 v.v0.bytes = bytes; v.v0.nbytes = nbytes; v.v0.flags = flags; v.v0.datatype = datatype; \
70 v.v0.exptime = exptime; v.v0.hashkey = NULL; v.v0.nhashkey = 0; \
73 #define LCB_DEPR_CTORS_ARITH \
74 lcb_arithmetic_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
75 lcb_arithmetic_cmd_st(const void *key, lcb_size_t nkey, lcb_int64_t delta, int create=0, \
76 lcb_uint64_t initial=0, lcb_time_t exptime=0) { \
77 version = 0; v.v0.key = key; v.v0.nkey = nkey; v.v0.exptime = exptime; \
78 v.v0.delta = delta; v.v0.create = create; v.v0.initial = initial; \
79 v.v0.hashkey = NULL; v.v0.nhashkey = 0; \
83 #define LCB_DEPR_CTORS_OBS \
84 lcb_observe_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
85 lcb_observe_cmd_st(const void *key, lcb_size_t nkey) { \
86 version = 0; v.v0.key = key; v.v0.nkey = nkey; v.v0.hashkey = NULL; v.v0.nhashkey = 0; \
89 #define LCB_DEPR_CTORS_RM \
90 lcb_remove_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
91 lcb_remove_cmd_st(const void *key, lcb_size_t nkey=0, lcb_cas_t cas=0) { \
92 version = 0; v.v0.key = key; \
93 if (key != NULL && nkey == 0) { v.v0.nkey = std::strlen((const char *)key);}\
94 else { v.v0.nkey = nkey; } \
95 v.v0.cas = cas; v.v0.hashkey = NULL; v.v0.nhashkey = 0; \
98 #define LCB_DEPR_CTORS_STATS \
99 lcb_server_stats_cmd_st(const char *name=NULL, lcb_size_t nname=0) { \
100 version = 0; v.v0.name = name; v.v0.nname = nname; \
101 if (name != NULL && nname == 0) { v.v0.nname = std::strlen(name); } \
102 else { v.v0.nname = nname; } \
105 #define LCB_DEPR_CTORS_VERBOSITY \
106 lcb_verbosity_cmd_st(lcb_verbosity_level_t level=LCB_VERBOSITY_WARNING, const char *server=NULL) { \
107 version = 0; v.v0.server = server; v.v0.level = level; \
110 #define LCB_DEPR_CTORS_VERSIONS \
111 lcb_server_version_cmd_st() { std::memset(this, 0, sizeof(*this)); }
113 #define LCB_DEPR_CTORS_FLUSH \
114 lcb_flush_cmd_st() { std::memset(this, 0, sizeof(*this)); }
116 #define LCB_DEPR_CTORS_CRST \
117 lcb_create_st(const char *host=NULL, const char *user=NULL,\
118 const char *passwd=NULL, const char *bucket=NULL, \
119 struct lcb_io_opt_st *io=NULL, lcb_type_t type=LCB_TYPE_BUCKET) { \
120 version = 2; v.v2.host = host; v.v2.user = user; v.v2.passwd = passwd; \
121 v.v2.bucket = bucket; v.v2.io = io; v.v2.type = type; v.v2.mchosts = NULL; \
122 v.v2.transports = NULL; \
125 #define LCB_DEPR_CTORS_HTTP \
126 lcb_http_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
127 lcb_http_cmd_st(const char *path, lcb_size_t npath, const void *body, \
128 lcb_size_t nbody, lcb_http_method_t method, \
129 int chunked, const char *content_type) { \
130 version = 0; v.v0.path = path; v.v0.npath = npath; v.v0.body = body; \
131 v.v0.nbody = nbody; v.v0.method = method; v.v0.chunked = chunked; \
132 v.v0.content_type = content_type; \
136 #define LCB_DEPR_CTORS_GET
137 #define LCB_DEPR_CTORS_RGET
138 #define LCB_DEPR_CTORS_UNL
139 #define LCB_DEPR_CTORS_STORE
140 #define LCB_DEPR_CTORS_ARITH
141 #define LCB_DEPR_CTORS_OBS
142 #define LCB_DEPR_CTORS_RM
143 #define LCB_DEPR_CTORS_STATS
144 #define LCB_DEPR_CTORS_VERBOSITY
145 #define LCB_DEPR_CTORS_VERSIONS
146 #define LCB_DEPR_CTORS_FLUSH
147 #define LCB_DEPR_CTORS_HTTP
148 #define LCB_DEPR_CTORS_CRST