abstract the internal representation of a sample

besides the old state being in dire need of cleaning up, this also paves the way for having any number of different sample representations in the system

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2018-10-26 16:25:26 +08:00
parent 6e1df4c564
commit a25f683bcf
52 changed files with 1400 additions and 1125 deletions

View file

@ -55,8 +55,7 @@ typedef _Return_type_success_(return > 0) int32_t dds_entity_t;
extern "C" {
#endif
/* FIXME: rename serdata, abstract it properly, etc */
struct serdata;
struct ddsi_serdata;
/**
* @brief Returns the default domain identifier.
@ -1710,7 +1709,7 @@ _Pre_satisfies_((writer & DDS_ENTITY_KIND_MASK) == DDS_KIND_WRITER)
DDS_EXPORT int
dds_writecdr(
dds_entity_t writer,
struct serdata *serdata);
struct ddsi_serdata *serdata);
/**
* @brief Write the value of a data instance along with the source timestamp passed.
@ -2722,7 +2721,7 @@ dds_take_mask_wl(
DDS_EXPORT int
dds_takecdr(
dds_entity_t reader_or_condition,
struct serdata **buf,
struct ddsi_serdata **buf,
uint32_t maxs,
dds_sample_info_t *si,
uint32_t mask);

View file

@ -56,7 +56,7 @@ dds_key_descriptor_t;
typedef struct dds_topic_descriptor
{
const size_t m_size; /* Size of topic type */
const uint32_t m_size; /* Size of topic type */
const uint32_t m_align; /* Alignment of topic type */
const uint32_t m_flagset; /* Flags */
const uint32_t m_nkeys; /* Number of keys (can be 0) */

View file

@ -45,8 +45,8 @@ dds_uptr_t;
typedef struct dds_stream
{
dds_uptr_t m_buffer; /* Union of pointers to start of buffer */
size_t m_size; /* Buffer size */
size_t m_index; /* Read/write offset from start of buffer */
uint32_t m_size; /* Buffer size */
uint32_t m_index; /* Read/write offset from start of buffer */
bool m_endian; /* Endian: big (false) or little (true) */
bool m_failed; /* Attempt made to read beyond end of buffer */
}
@ -55,13 +55,13 @@ dds_stream_t;
#define DDS_STREAM_BE false
#define DDS_STREAM_LE true
DDS_EXPORT dds_stream_t * dds_stream_create (size_t size);
DDS_EXPORT dds_stream_t * dds_stream_create (uint32_t size);
DDS_EXPORT dds_stream_t * dds_stream_from_buffer (const void *buf, size_t sz, int bswap);
DDS_EXPORT void dds_stream_delete (dds_stream_t * st);
DDS_EXPORT void dds_stream_fini (dds_stream_t * st);
DDS_EXPORT void dds_stream_reset (dds_stream_t * st);
DDS_EXPORT void dds_stream_init (dds_stream_t * st, size_t size);
DDS_EXPORT void dds_stream_grow (dds_stream_t * st, size_t size);
DDS_EXPORT void dds_stream_init (dds_stream_t * st, uint32_t size);
DDS_EXPORT void dds_stream_grow (dds_stream_t * st, uint32_t size);
DDS_EXPORT bool dds_stream_endian (void);
struct dds_topic_descriptor;