[wsf-c-dev] [C++] Question on data types
Damitha Kumarage
damitha at wso2.com
Tue Oct 16 15:47:17 PDT 2007
Senaka Fernando wrote:
>Yes, that is a good choice, but don't we miss out in defining boolean
>types using integers?
>
>Because C++ defines bool, we instead can use a subset of types defined
>in axis, and use the new additions from C++
>
>BTW, this only affects the interaction through the API. The internal
>core will remain the same as C.
>
>Therefore the C++ developers will feel more comfortable dealing with
>types derived from bool, when it is a true-false scenario instead of the
>AXIS implementation
>
>
hmmm,
Say axis2c api function function foo is
axis2_bool_t foo()
and it is wrapped in c++ function bool bar()
axis2_bool_t
foo(void)
{
return AXIS2_FALSE;
}
bool bar(void)
{
std::cout << "In C++ wrapper function \n";
return foo();
}
Then C++ user experience would be
bool ret;
ret = bar();
if(ret == true)
std::cout << "Success \n";
if(ret == false)
std::cout << "Failure \n";
OK. I agree with you
Damitha
>What do you say?
>
>On Tue, 2007-10-16 at 16:27 +0530, Damitha Kumarage wrote:
>
>
>>Senaka Fernando wrote:
>>
>>
>>
>>>Is it better to proceed with the addition of C++ primitive types
>>>sparingly, or only with types defined in AXUTIL_..? (for instance, the
>>>bool type can be re-defined or the existing definition in
>>>AXUTIL_UTILS_DEFINES.h can be used which is derived from int)
>>>
>>>Which would be better and why?
>>>
>>>
>>>
>>>
>>Since you are going to write a set of C++ wrapper functions over C I
>>think it is better to adhere to existing typing instead of doing type
>>mapping between C++ and C.
>>Damitha
>>
>>
>>
>>>Regards,
>>>
>>>Senaka
>>>
>>>
>>>_______________________________________________
>>>Wsf-c-dev mailing list
>>>Wsf-c-dev at wso2.org
>>>http://wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev
>>>
>>>
>>>
>>>
>>>
>>_______________________________________________
>>Wsf-c-dev mailing list
>>Wsf-c-dev at wso2.org
>>http://wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev
>>
>>
>
>
>_______________________________________________
>Wsf-c-dev mailing list
>Wsf-c-dev at wso2.org
>http://wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev
>
>
>
More information about the Wsf-c-dev
mailing list