24 #include <interface/interface_info.h> 25 #include <interface/interface.h> 26 #include <utils/misc/strndup.h> 48 unsigned int serial,
bool has_writer,
unsigned int num_readers)
50 __type = strndup(type, __INTERFACE_TYPE_SIZE);
51 __id = strndup(
id, __INTERFACE_ID_SIZE);
52 __hash = (
unsigned char *)malloc(__INTERFACE_HASH_SIZE);
53 memcpy(__hash, hash, __INTERFACE_HASH_SIZE);
65 __type = strndup(i.__type, __INTERFACE_TYPE_SIZE);
66 __id = strndup(i.__id, __INTERFACE_ID_SIZE);
67 __hash = (
unsigned char *)malloc(__INTERFACE_HASH_SIZE);
68 memcpy(__hash, i.__hash, __INTERFACE_HASH_SIZE);
69 __has_writer = i.__has_writer;
70 __num_readers = i.__num_readers;
71 __serial = i.__serial;
107 const unsigned char *
130 return __num_readers;
155 int td = strncmp(__type, ii.__type, __INTERFACE_TYPE_SIZE);
161 return (strncmp(__id, ii.__id, __INTERFACE_ID_SIZE) < 0);
184 push_back(
InterfaceInfo(type,
id, hash, serial, has_writer, num_readers));
const char * id() const
Get interface ID.
const char * type() const
Get interface type.
bool operator<(const InterfaceInfo &ii) const
< operator This compares two interface infos with respect to the less than (<) relation considering t...
Fawkes library namespace.
bool has_writer() const
Check if there is a writer.
unsigned int serial() const
Get interface instance serial.
~InterfaceInfo()
Destructor.
InterfaceInfo(const char *type, const char *id, const unsigned char *hash, unsigned int serial, bool has_writer, unsigned int num_readers)
Constructor.
void append(const char *type, const char *id, const unsigned char *hash, unsigned int serial, bool has_writer, unsigned int num_readers)
Append an interface info.
unsigned int num_readers() const
Get number of readers.
const unsigned char * hash() const
Get interface version hash.