|
|
@ -434,7 +434,7 @@ namespace pEp { |
|
|
|
class TestStruct1 { |
|
|
|
public: |
|
|
|
// Create a new instance
|
|
|
|
TestStruct1(int i, Test_enum e, const std::string& str) |
|
|
|
TestStruct1(int i, ::Test_enum e, const std::string& str) |
|
|
|
{ |
|
|
|
pEpLogClass("called"); |
|
|
|
_c_struct_p = ::new_test_struct(0, ONE, nullptr); //dont use raw-setters
|
|
|
@ -453,13 +453,13 @@ namespace pEp { |
|
|
|
|
|
|
|
// Best to use this constructor, as the object is in a valid state when the wrapped
|
|
|
|
// c_struct_pp is known
|
|
|
|
TestStruct1(bool is_owner, Test_struct1** c_struct_pp) |
|
|
|
TestStruct1(bool is_owner, ::Test_struct1** c_struct_pp) |
|
|
|
{ |
|
|
|
pEpLogClass("called"); |
|
|
|
bind(is_owner, c_struct_pp); |
|
|
|
} |
|
|
|
|
|
|
|
void bind(bool is_owner, Test_struct1** c_struct_pp) |
|
|
|
void bind(bool is_owner, ::Test_struct1** c_struct_pp) |
|
|
|
{ |
|
|
|
if (c_struct_pp == nullptr) { |
|
|
|
throw Exception{ EXSTR("cant bind on a nullptr") }; |
|
|
@ -508,7 +508,7 @@ namespace pEp { |
|
|
|
} |
|
|
|
|
|
|
|
pEp::POD<int> c_int{}; |
|
|
|
pEp::POD<Test_enum> c_enum{}; |
|
|
|
pEp::POD<::Test_enum> c_enum{}; |
|
|
|
pEp::String c_str{}; |
|
|
|
|
|
|
|
static bool log_enabled; |
|
|
@ -553,10 +553,10 @@ int main() |
|
|
|
// value types are being copied around (stack)
|
|
|
|
static_assert(std::is_pod<int>::value && !std::is_pointer<int>::value, "not an integral"); |
|
|
|
static_assert( |
|
|
|
std::is_pod<Test_enum>::value && !std::is_pointer<Test_enum>::value, |
|
|
|
std::is_pod<::Test_enum>::value && !std::is_pointer<::Test_enum>::value, |
|
|
|
"not an integral"); |
|
|
|
static_assert( |
|
|
|
std::is_pod<Test_struct1>::value && !std::is_pointer<Test_struct1>::value, |
|
|
|
std::is_pod<::Test_struct1>::value && !std::is_pointer<::Test_struct1>::value, |
|
|
|
"not an integral"); |
|
|
|
|
|
|
|
// pEp::Utils::readKey();
|
|
|
@ -656,6 +656,7 @@ int main() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Struct
|
|
|
|
if (0) { |
|
|
|
// create
|
|
|
|
{ |
|
|
@ -664,7 +665,7 @@ int main() |
|
|
|
pEpLog(pstruct1.c_enum); |
|
|
|
pEpLog(pstruct1.c_str); |
|
|
|
|
|
|
|
Test_struct1* c_struct1 = pstruct1; |
|
|
|
::Test_struct1* c_struct1 = pstruct1; |
|
|
|
pEpLog(c_struct1->c_int); |
|
|
|
pEpLog(c_struct1->c_enum); |
|
|
|
pEpLog(c_struct1->c_str); |
|
|
@ -673,7 +674,7 @@ int main() |
|
|
|
|
|
|
|
// wrap
|
|
|
|
{ |
|
|
|
Test_struct1* c_struct1 = new_test_struct(0, ONE, "pEp"); |
|
|
|
::Test_struct1* c_struct1 = new_test_struct(0, ONE, "pEp"); |
|
|
|
pEpLog(c_struct1->c_int); |
|
|
|
pEpLog(c_struct1->c_enum); |
|
|
|
pEpLog(c_struct1->c_str); |
|
|
|