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
Compare and Show latest version
1 file
+ 21
6
Compare changes
  • Side-by-side
  • Inline
+ 21
6
@@ -469,9 +469,6 @@ ERROR_RETURN_CODE(GENERIC_ERROR,
return status.GetCode();
})
// TODO(fspreck) Results sets have to be worked over once they have
// been fixed in the cpplib. Afterwards, creation and at have to be
// re-implemented.
ERROR_RETURN_CODE(GENERIC_ERROR,
int caosdb_transaction_transaction_get_result_set(
caosdb_transaction_transaction *transaction,
@@ -506,9 +503,6 @@ ERROR_RETURN_CODE(GENERIC_ERROR,
caosdb_transaction_result_set *result_set,
caosdb_entity_entity *entity, int index),
{
// TODO(fspreck) how do we treat this? ResultSet
// is an abstract class, can we always fall back
// to MultiResultSet?
auto *wrapped_result_set =
static_cast<caosdb::transaction::MultiResultSet *>(
result_set->wrapped_result_set);
@@ -747,6 +741,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