A list for the developers of CellML tools

Text archives Help


[cellml-dev] CellML wchar sizes


Chronological Thread 
  • From: ak.miller at auckland.ac.nz (Andrew Miller)
  • Subject: [cellml-dev] CellML wchar sizes
  • Date: Thu, 03 Dec 2009 12:21:17 +1300

Lucian Smith wrote:
> * Andrew Miller <ak.miller at auckland.ac.nz> [2009-12-01 20:36] writes:
>> Lucian Smith wrote:
>>> * Andrew Miller <ak.miller at auckland.ac.nz> [2009-12-01 02:11] writes:
>>>> nsresult rv;
>>>> nsCOMPtr<cellml_apiICellMLBootstrap>
>>>> boot(do_GetService(CELLML_BOOTSTRAP_CID, &rv));
>>>> NS_ENSURE_SUCCESS(rv, rv);
>>>> nsCOMPtr<cellml_apiIModel> mod;
>>>> rv = boot->CreateModel(NS_LITERAL_STRING("1.1"), getter_AddRefs(mod));
>>>> NS_ENSURE_SUCCESS(rv, rv);
>>>>
>>> Am I right in assuming that if I want to use OpenCell's DataCollector
>>> library (cellml-opencell/opencellStage/components/libDataCollector.so ) I
>>> will need to use XPCOM, and write code like the above, in order to use
>>> functions like MathMLToInputFormat, which takes an nsCString as an
>>> argument?
>> Yes, unless you want to port it to not use XPCOM.
>>
>>> If so, where do the functions 'boot' and 'do_GetService' come from (as
>>> well as the (I assume) #define's) from your example?
>> boot is not a function - this is C++ syntax for passing arguments to an
>> object constructor.
>
> Whoops, I knew that. Wasn't paying close enough attention when I asked
> the question; sorry. The other information was indeed helpful, and I
> think I basically have it, except:
>
>> CELLML_BOOTSTRAP_CID may need to be pasted in from
>> CellMLBootstrapXPCOM.cpp explicitly, we don't seem to have a header for
>> it (but maybe we should consider this).
>> #define CELLML_BOOTSTRAP_CID \
>> { /* 56849f69-c321-4be6-9191-1bb2ee0a76e0 */ \
>> 0x56849f69, \
>> 0xc321, \
>> 0x4be6, \
>> {0x91, 0x91, 0x1b, 0xb2, 0xee, 0x0a, 0x75, 0xe0} \
>> }
>
> This is the bit that I'm having problems with--if I #define this at the
> top of the file, the line:
>
> nsCOMPtr<cellml_apiICellMLBootstrap>
> boot(do_GetService(CELLML_BOOTSTRAP_CID, &rv));

My bad, it actually needs CELLML_BOOTSTRAP_CONTRACTID in there, which is
actually:
#define CELLML_BOOTSTRAP_CONTRACTID "@cellml.org/cellml-bootstrap;1"

We really should put all the contract IDs in a header somewhere.

Best wishes,
Andrew

>
> gives me the error:
>
> src/module-cellml.cpp:230: error: expected primary-expression before '{'
> token
>
> -Lucian
> _______________________________________________
> cellml-tools-developers mailing list
> cellml-tools-developers at cellml.org
> http://www.cellml.org/mailman/listinfo/cellml-tools-developers





Archive powered by MHonArc 2.6.18.

Top of page