Skip to content

Commit

Permalink
FesapiHelpers now also support UUID only methods
Browse files Browse the repository at this point in the history
  • Loading branch information
philippeVerney committed Oct 7, 2024
1 parent 66bbb79 commit 4900667
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cmake/swigEtp1_2Include.i.in
Original file line number Diff line number Diff line change
Expand Up @@ -2162,12 +2162,31 @@ namespace ETP_NS
*/
Energistics::Etp::v12::Datatypes::Object::Resource buildEtpResourceFromEnergisticsObject(COMMON_NS::AbstractObject const* obj, bool countRels = true);

/**
* Build and return an ETP resource from an Energistics object defined by an UUID in a DataObjectRepository.
* @param repo The repository where the required UUID is defined
* @param uuid The UUID describing the Energistics object
* @param countRels Indicate if the returned resource contain the count of source or target relationships.
* @return The ETP resource built from the Energistics object
*/
Energistics::Etp::v12::Datatypes::Object::Resource buildEtpResourceFromEnergisticsObject(
COMMON_NS::DataObjectRepository const* repo, const std::string& uuid, bool countRels = true);

/**
* Build and return an ETP data object from an Energistics object.
* @param obj The input Energistics obj
* @return The ETP data object built from the Energistics object
*/
Energistics::Etp::v12::Datatypes::Object::DataObject buildEtpDataObjectFromEnergisticsObject(COMMON_NS::AbstractObject * obj, bool includeSerialization = true);

/**
* Build and return an ETP data object from an Energistics object defined by an UUID in a DataObjectRepository.
* @param repo The repository where the required UUID is defined
* @param uuid The UUID describing the Energistics object
* @return The ETP data object built from the Energistics object
*/
Energistics::Etp::v12::Datatypes::Object::DataObject buildEtpDataObjectFromEnergisticsObject(
COMMON_NS::DataObjectRepository const* repo, const std::string& uuid, bool includeSerialization = true);
}
#endif
}
Expand Down
10 changes: 10 additions & 0 deletions src/etp/fesapi/FesapiHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ Energistics::Etp::v12::Datatypes::Object::Resource ETP_NS::FesapiHelpers::buildE
return result;
}

Energistics::Etp::v12::Datatypes::Object::Resource ETP_NS::FesapiHelpers::buildEtpResourceFromEnergisticsObject(
COMMON_NS::DataObjectRepository const* repo, const std::string& uuid, bool countRels) {
return buildEtpResourceFromEnergisticsObject(repo->getDataObjectByUuid(uuid), countRels);
}

Energistics::Etp::v12::Datatypes::Object::DataObject ETP_NS::FesapiHelpers::buildEtpDataObjectFromEnergisticsObject(COMMON_NS::AbstractObject * obj, bool includeSerialization)
{
Energistics::Etp::v12::Datatypes::Object::DataObject result;
Expand All @@ -68,3 +73,8 @@ Energistics::Etp::v12::Datatypes::Object::DataObject ETP_NS::FesapiHelpers::buil

return result;
}

Energistics::Etp::v12::Datatypes::Object::DataObject ETP_NS::FesapiHelpers::buildEtpDataObjectFromEnergisticsObject(
COMMON_NS::DataObjectRepository const* repo, const std::string& uuid, bool includeSerialization) {
return buildEtpDataObjectFromEnergisticsObject(repo->getDataObjectByUuid(uuid), includeSerialization);
}
19 changes: 19 additions & 0 deletions src/etp/fesapi/FesapiHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,30 @@ namespace ETP_NS
*/
FETPAPI_DLL_IMPORT_OR_EXPORT Energistics::Etp::v12::Datatypes::Object::Resource buildEtpResourceFromEnergisticsObject(COMMON_NS::AbstractObject const* obj, bool countRels = true);

/**
* Build and return an ETP resource from an Energistics object defined by an UUID in a DataObjectRepository.
* @param repo The repository where the required UUID is defined
* @param uuid The UUID describing the Energistics object
* @param countRels Indicate if the returned resource contain the count of source or target relationships.
* @return The ETP resource built from the Energistics object
*/
FETPAPI_DLL_IMPORT_OR_EXPORT Energistics::Etp::v12::Datatypes::Object::Resource buildEtpResourceFromEnergisticsObject(
COMMON_NS::DataObjectRepository const* repo, const std::string& uuid, bool countRels = true);

/**
* Build and return an ETP data object from an Energistics object.
* @param obj The input Energistics obj
* @return The ETP data object built from the Energistics object
*/
FETPAPI_DLL_IMPORT_OR_EXPORT Energistics::Etp::v12::Datatypes::Object::DataObject buildEtpDataObjectFromEnergisticsObject(COMMON_NS::AbstractObject * obj, bool includeSerialization = true);

/**
* Build and return an ETP data object from an Energistics object defined by an UUID in a DataObjectRepository.
* @param repo The repository where the required UUID is defined
* @param uuid The UUID describing the Energistics object
* @return The ETP data object built from the Energistics object
*/
FETPAPI_DLL_IMPORT_OR_EXPORT Energistics::Etp::v12::Datatypes::Object::DataObject buildEtpDataObjectFromEnergisticsObject(
COMMON_NS::DataObjectRepository const* repo, const std::string& uuid, bool includeSerialization = true);
}
}

0 comments on commit 4900667

Please sign in to comment.