Skip to content
Snippets Groups Projects

ENH: Add retrieval and queries to Extern C interface

Merged Florian Spreckelsen requested to merge f-extended-c into f-files
1 file
+ 21
0
Compare changes
  • Side-by-side
  • Inline
+ 21
0
@@ -747,6 +747,27 @@ CAOSDB_PROPERTY_GET(datatype,
CAOSDB_PROPERTY_GET(unit, strcpy(out, wrapped_property->GetUnit().c_str());)
CAOSDB_PROPERTY_GET(value, strcpy(out, wrapped_property->GetValue().c_str());)
ERROR_RETURN_CODE(
GENERIC_ERROR,
int caosdb_entity_message_get_code(caosdb_entity_message *message, int *out),
{
auto *wrapped_message =
static_cast<caosdb::entity::Message *>(message->wrapped_message);
*out = wrapped_message->GetCode();
return 0;
})
ERROR_RETURN_CODE(
GENERIC_ERROR,
int caosdb_entity_message_get_description(caosdb_entity_message *message,
char *out),
{
auto *wrapped_message =
static_cast<caosdb::entity::Message *>(message->wrapped_message);
strcpy(out, wrapped_message->GetDescription().c_str());
return 0;
})
CAOSDB_ENTITY_SET(role, role, wrapped_entity->SetRole(std::string(role));)
CAOSDB_ENTITY_SET(name, name, wrapped_entity->SetName(std::string(name));)
CAOSDB_ENTITY_SET(description, description,
Loading