55 setInt(asInt() + var.
asInt());
58 setGauge(asGauge() + var.
asGauge());
61 setCounter(asCounter() + var.
asCounter());
83 setInt(asInt() / num);
86 setGauge(asGauge() / num);
89 setCounter(asCounter() / num);
92 setCounter64(asCounter64() / num);
95 setTimeTicks(asTimeTicks() / num);
110 return asInt() < var.
asInt();
112 return asGauge() < var.
asGauge();
132 return asInt() > var.
asInt();
134 return asGauge() > var.
asGauge();
175 name_length = aName.
size();
176 name =
static_cast<oid*
>(
xmalloc(name_length *
sizeof(
oid)));
177 std::copy(aName.
start, aName.
end, name);
185 val.string =
nullptr;
200 Must(val.integer !=
nullptr && val_len ==
sizeof(
int));
208 Must(val.integer !=
nullptr && val_len == 4);
209 return *
reinterpret_cast<unsigned int*
>(val.integer);
216 Must(val.integer !=
nullptr && val_len == 4);
217 return *
reinterpret_cast<int*
>(val.integer);
224 Must(val.integer !=
nullptr && val_len == 8);
225 return *
reinterpret_cast<long long int*
>(val.integer);
232 Must(val.integer !=
nullptr && val_len ==
sizeof(
unsigned int));
233 return *
reinterpret_cast<unsigned int*
>(val.integer);
240 Must(val_len %
sizeof(
oid) == 0);
241 int length = val_len /
sizeof(
oid);
242 Must(val.objid !=
nullptr && length > 0);
250 Must(val.string !=
nullptr && val_len > 0);
306 if (value !=
nullptr) {
307 Must(length > 0 && aType > 0);
308 val.string =
static_cast<u_char*
>(
xmalloc(length));
309 memcpy(val.string, value, length);
327 if (name_length > 0) {
328 Must(name !=
nullptr);
334 Must(val.string !=
nullptr);
344 name_length = msg.
getInt();
345 Must(name_length >= 0);
346 if (name_length > 0) {
347 name =
static_cast<oid*
>(
xmalloc(name_length *
sizeof(
oid)));
354 val.string =
static_cast<u_char*
>(
xmalloc(val_len));
#define TexcHere(msg)
legacy convenience macro; it is not difficult to type Here() now
struct msghdr with a known type, fixed-size I/O and control buffers
void getFixed(void *raw, size_t size) const
always load size bytes
void putInt(int n)
store an integer
void getPod(Pod &pod) const
load POD
void putFixed(const void *raw, size_t size)
always store size bytes
void putPod(const Pod &pod)
store POD
int getInt() const
load an integer
void setCounter64(long long int counter)
assign Counter64 value to variable
void setInt(int value)
assign int value to variable
Var & operator+=(const Var &var)
Var & operator=(const Var &var)
Var & operator/=(int num)
void copyValue(const Var &var)
copy variable from another one
void setObject(const Range< const oid * > &object)
assign object oid to variable
unsigned int asGauge() const
returns variable value as unsigned int
bool operator<(const Var &var) const
void unpack(const Ipc::TypedMsgHdr &msg)
restore struct from the message
bool operator>(const Var &var) const
void clearName()
clear variable name
void setTimeTicks(unsigned int ticks)
assign unsigned int (time) value to variable
void clear()
clear all internal members
Range< const oid * > getName() const
returns variable name
void setValue(const void *value, int length, int aType)
set new variable value
int asCounter() const
returns variable value as Counter32
void init()
initialize members
int asInt() const
returns variable value as integer
void setCounter(int value)
assign Counter32 value to variable
long long int asCounter64() const
returns variable value as Counter64
unsigned int asTimeTicks() const
returns variable value as time ticks
void setGauge(unsigned int value)
assign unsigned int value to variable
Range< const oid * > asObject() const
returns variable value as object oid
void assign(const Var &var)
perform full assignment
void pack(Ipc::TypedMsgHdr &msg) const
prepare for sendmsg()
void setString(const Range< const u_char * > &string)
assign string to variable
void setName(const Range< const oid * > &aName)
set new variable name
void clearValue()
clear .val member
Range< const u_char * > asString() const
returns variable value as chars string
#define debugs(SECTION, LEVEL, CONTENT)
static void copyValue(void *dst, const DB_ENTRY *src, size_t sz)
union variable_list::@19 val