Skip to content

Commit 70b6f2a

Browse files
Replace boost::optional with std::optional and boost::any with std::variant
Migrated all uses of boost::optional to std::optional and updated related code to use .value() and .has_value() instead of .get() and .is_initialized(). Refactored union types to use std::variant instead of boost::any, and updated Avro codec_traits for std::optional. Also updated usages in example, protocol handlers, and data array handlers to match new APIs.
1 parent 5f18443 commit 70b6f2a

7 files changed

Lines changed: 215 additions & 600 deletions

File tree

example/withFesapi/etpClient.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ void askUser(std::shared_ptr<ETP_NS::AbstractSession> session, COMMON_NS::DataOb
196196
const auto resources = session->getResources(mb.context, mb.scope);
197197
for (auto& resource : resources) {
198198
std::cout << resource.uri << std::endl;
199-
if (resource.has_sourceCount()) std::cout << "Source count: " << resource.sourceCount.get() << std::endl;
200-
if (resource.has_targetCount()) std::cout << "Target count: " << resource.targetCount.get() << std::endl;
199+
if (resource.has_sourceCount()) std::cout << "Source count: " << resource.sourceCount.value() << std::endl;
200+
if (resource.has_targetCount()) std::cout << "Target count: " << resource.targetCount.value() << std::endl;
201201
}
202202
continue;
203203
}
@@ -680,7 +680,7 @@ void askUser(std::shared_ptr<ETP_NS::AbstractSession> session, COMMON_NS::DataOb
680680
Energistics::Etp::v12::Datatypes::AnyArray data;
681681
Energistics::Etp::v12::Datatypes::ArrayOfInt arrayOfInt;
682682
arrayOfInt.values = { 0,1,2,3,4,5,6,7,8,9 };
683-
data.item.set_ArrayOfInt(arrayOfInt);
683+
data.item.set_ArrayOfInt(std::move(arrayOfInt));
684684
pda.dataArrays["0"].array.data = data;
685685
std::cout << "Start sending the array" << std::endl;
686686

0 commit comments

Comments
 (0)