diff options
Diffstat (limited to 'matlab/src/IceMatlab')
-rw-r--r-- | matlab/src/IceMatlab/Connection.cpp | 20 | ||||
-rw-r--r-- | matlab/src/IceMatlab/Endpoint.cpp | 4 | ||||
-rw-r--r-- | matlab/src/IceMatlab/Endpoint.h | 2 | ||||
-rw-r--r-- | matlab/src/IceMatlab/ObjectPrx.cpp | 6 | ||||
-rw-r--r-- | matlab/src/IceMatlab/icematlab.h | 3 |
5 files changed, 26 insertions, 9 deletions
diff --git a/matlab/src/IceMatlab/Connection.cpp b/matlab/src/IceMatlab/Connection.cpp index 5e4053b033f..4e06def390c 100644 --- a/matlab/src/IceMatlab/Connection.cpp +++ b/matlab/src/IceMatlab/Connection.cpp @@ -15,7 +15,8 @@ #include "Future.h" #include "Util.h" -#define SELF (*(reinterpret_cast<shared_ptr<Ice::Connection>*>(self))) +#define DEREF(x) (*(reinterpret_cast<shared_ptr<Ice::Connection>*>(x))) +#define SELF DEREF(self) using namespace std; using namespace IceMatlab; @@ -61,7 +62,7 @@ static const char* infoFields[] = }; mxArray* -createInfo(shared_ptr<Ice::ConnectionInfo> info) +createInfo(const shared_ptr<Ice::ConnectionInfo>& info) { // // Create and return a struct array containing the fields that describe the EndpointInfo object. @@ -142,6 +143,21 @@ Ice_Connection__release(void* self) } EXPORTED_FUNCTION mxArray* +Ice_Connection_equals(void* self, void* other) +{ + assert(other); // Wrapper only calls this function for non-nil arguments. + try + { + return createResultValue(createBool(SELF == DEREF(other))); + } + catch(const std::exception& ex) + { + return createResultException(convertException(ex)); + } + return 0; +} + +EXPORTED_FUNCTION mxArray* Ice_Connection_close(void* self, mxArray* m) { try diff --git a/matlab/src/IceMatlab/Endpoint.cpp b/matlab/src/IceMatlab/Endpoint.cpp index 78688469262..bb9dfca9862 100644 --- a/matlab/src/IceMatlab/Endpoint.cpp +++ b/matlab/src/IceMatlab/Endpoint.cpp @@ -21,7 +21,7 @@ using namespace std; using namespace IceMatlab; void* -IceMatlab::createEndpoint(shared_ptr<Ice::Endpoint> p) +IceMatlab::createEndpoint(const shared_ptr<Ice::Endpoint>& p) { return new shared_ptr<Ice::Endpoint>(p); } @@ -73,7 +73,7 @@ static const char* infoFields[] = }; mxArray* -createInfo(shared_ptr<Ice::EndpointInfo> info) +createInfo(const shared_ptr<Ice::EndpointInfo>& info) { // // Create and return a struct array containing the fields that describe the EndpointInfo object. diff --git a/matlab/src/IceMatlab/Endpoint.h b/matlab/src/IceMatlab/Endpoint.h index f3c6a4b41ed..42878c38e56 100644 --- a/matlab/src/IceMatlab/Endpoint.h +++ b/matlab/src/IceMatlab/Endpoint.h @@ -12,7 +12,7 @@ namespace IceMatlab { -void* createEndpoint(std::shared_ptr<Ice::Endpoint>); +void* createEndpoint(const std::shared_ptr<Ice::Endpoint>&); std::shared_ptr<Ice::Endpoint> getEndpoint(void*); } diff --git a/matlab/src/IceMatlab/ObjectPrx.cpp b/matlab/src/IceMatlab/ObjectPrx.cpp index 11242b88ca2..8ce5a98f9b8 100644 --- a/matlab/src/IceMatlab/ObjectPrx.cpp +++ b/matlab/src/IceMatlab/ObjectPrx.cpp @@ -234,16 +234,16 @@ Ice_ObjectPrx__release(void* self) } EXPORTED_FUNCTION mxArray* -Ice_ObjectPrx_equals(void* self, void* other, unsigned char* r) +Ice_ObjectPrx_equals(void* self, void* other) { assert(other); // Wrapper only calls this function for non-nil arguments. try { - *r = Ice::targetEqualTo(SELF, DEREF(other)) ? 1 : 0; + return createResultValue(createBool(Ice::targetEqualTo(SELF, DEREF(other)))); } catch(const std::exception& ex) { - return convertException(ex); + return createResultException(convertException(ex)); } return 0; } diff --git a/matlab/src/IceMatlab/icematlab.h b/matlab/src/IceMatlab/icematlab.h index d7d65e18f6f..facdc81364e 100644 --- a/matlab/src/IceMatlab/icematlab.h +++ b/matlab/src/IceMatlab/icematlab.h @@ -51,7 +51,7 @@ EXPORTED_FUNCTION mxArray* Ice_Communicator_flushBatchRequests(void*, mxArray*); EXPORTED_FUNCTION mxArray* Ice_Communicator_flushBatchRequestsAsync(void*, mxArray*, void**); EXPORTED_FUNCTION mxArray* Ice_ObjectPrx__release(void*); -EXPORTED_FUNCTION mxArray* Ice_ObjectPrx_equals(void*, void*, unsigned char*); +EXPORTED_FUNCTION mxArray* Ice_ObjectPrx_equals(void*, void*); EXPORTED_FUNCTION mxArray* Ice_ObjectPrx_read(void*, mxArray*, mxArray*, int, int, void**); EXPORTED_FUNCTION mxArray* Ice_ObjectPrx_write(void*, void*, mxArray*); EXPORTED_FUNCTION mxArray* Ice_ObjectPrx_ice_invoke(void*, const char*, int, mxArray*, unsigned int, mxArray*); @@ -148,6 +148,7 @@ EXPORTED_FUNCTION mxArray* Ice_Properties_load(void*, const char*); EXPORTED_FUNCTION mxArray* Ice_Properties_clone(void*, void**); EXPORTED_FUNCTION mxArray* Ice_Connection__release(void*); +EXPORTED_FUNCTION mxArray* Ice_Connection_equals(void*, void*); EXPORTED_FUNCTION mxArray* Ice_Connection_close(void*, mxArray*); EXPORTED_FUNCTION mxArray* Ice_Connection_closeAsync(void*, mxArray*, void**); EXPORTED_FUNCTION mxArray* Ice_Connection_createProxy(void*, mxArray*, void**); |