Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timestamps to rmw-internal structures. #200

Closed
wants to merge 12 commits into from
26 changes: 19 additions & 7 deletions rmw/include/rmw/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,47 +170,59 @@ typedef struct RMW_PUBLIC_TYPE rmw_subscription_allocation_t

/// Array of subscriber handles.
/**
* An array of void * pointers representing type-erased middleware-specific subscriptions.
* An array of void * pointers representing type-erased middleware-specific subscriptions,
* and arrival timestamp information for the entries (in the same order).
* The number of non-null entries may be smaller than the allocated size of the array.
* The number of subscriptions represented may be smaller than the allocated size of the array.
* The creator of this struct is responsible for allocating and deallocating the array.
* The creator of this struct is responsible for allocating and deallocating the array,
* including the timestamp array.
*/
typedef struct RMW_PUBLIC_TYPE rmw_subscriptions_t
{
/// The number of subscribers represented by the array.
size_t subscriber_count;
/// Pointer to an array of void * pointers of subscriptions.
void ** subscribers;
/// Pointer to an array of rcutils timestamps, to be filled in same order as the above.
rcutils_time_point_value_t * timestamps;
} rmw_subscriptions_t;

/// Array of service handles.
/**
* An array of void * pointers representing type-erased middleware-specific services.
* An array of void * pointers representing type-erased middleware-specific services,
* and arrival timestamp information for the entries (in the same order).
* The number of non-null entries may be smaller than the allocated size of the array.
* The number of services represented may be smaller than the allocated size of the array.
* The creator of this struct is responsible for allocating and deallocating the array.
* The creator of this struct is responsible for allocating and deallocating the array,
* including the timestamp array.
*/
typedef struct RMW_PUBLIC_TYPE rmw_services_t
{
/// The number of services represented by the array.
size_t service_count;
/// Pointer to an array of void * pointers of services.
void ** services;
/// Pointer to an array of rcutils timestamps, to be filled in same order as the above.
rcutils_time_point_value_t * timestamps;
} rmw_services_t;

/// Array of client handles.
/**
* An array of void * pointers representing type-erased middleware-specific clients.
* An array of void * pointers representing type-erased middleware-specific clients,
* and arrival timestamp information for the entries (in the same order).
* The number of non-null entries may be smaller than the allocated size of the array.
* The number of clients represented may be smaller than the allocated size of the array.
* The creator of this struct is responsible for allocating and deallocating the array.
* The creator of this struct is responsible for allocating and deallocating the array,
* including the timestamp array.
*/
typedef struct RMW_PUBLIC_TYPE rmw_clients_t
{
/// The number of clients represented by the array.
size_t client_count;
/// Pointer to an array of void * pointers of clients.
void ** clients;
/// Pointer to an array of rcutils timestamps, to be filled in same order as the above.
rcutils_time_point_value_t * timestamps;
} rmw_clients_t;

typedef struct RMW_PUBLIC_TYPE rmw_events_t
Expand Down Expand Up @@ -332,7 +344,7 @@ typedef struct RMW_PUBLIC_TYPE rmw_gid_t

typedef struct RMW_PUBLIC_TYPE rmw_message_info_t
{
// const rmw_time_t received_timestamp;
rmw_time_t received_timestamp;
rmw_gid_t publisher_gid;
bool from_intra_process;
} rmw_message_info_t;
Expand Down