[cosmic-users] RE: [cosmic-dev] PRF

James Hill hillj at isis.vanderbilt.edu
Sat Apr 22 20:00:19 CDT 2006


Hey Nick, 

[...]

> I work for Paul Legault/John Slaby on a Research and 
> Development project. I am using GME (5.9.21) and CoSMIC 
> (0.4.8). I created the following .idl file and ran 
> idl_to_picml, and imported it into a PICML paradigm.  (Env.xme file
> attached)
> 
> //ProxyComponent.idl,v 1.1 2006
> 
> #include <Components.idl>
> 
> module MyProxyComponent
> {
>   struct EnvNV
>   {
>     string EnvName;
>     string EnvValue;
>   };
> 
>   typedef sequence < EnvNV > EnvNVtype;
> 
>   interface Dummy {
>       void DoNothing();
>   };
> 
>   /**
>    * @class ProxyCOmponent
>    *
>    * @brief component
>    */
>   component ProxyComponent supports Dummy
>   {
>       attribute string theString;
>       attribute EnvNVtype EnvNVs;
>   };
> 
>   /**
>    * @class ProxyComponentHome
>    *
>    * @brief home for ProxyComponent component
>    */
>   home ProxyComponentHome manages ProxyComponent
>   {
>   };
> };
> 
> 
> The goal of the EnvNVs is to create 0..N name/value 
> environment variable pairs attributes that I will use to 
> build a environment string to pass to execle. The PICML model 
> shows them as aggregates and a collection. I have no clue on 
> how I can create instances of the N/V pairs. Any guidance 
> would be appreciated.
> 

By creating instances, I assume you are referring to creating complex
types on assemblies, which in turn get placed into deployment plans and
set on component instances at deployment time. We currently do not
support this feature in PICML  right now (still a work in progress), and
I do not know whether or not DAnCE even supports complex types in
deployment descriptors. Someone else may be able to speak on the status
of that functionality.

However there is a workaround. You can specify a string attribute type a
component, e.g., 

component MyComponent 
{
  attribute string Envs_Workaround;
};

and instantiate the attribute for that particular instance with a
encoded string type, e.g.,

(Name1=Env1);(Name2=Env2);(Name3=Env3); 

In the implementation for setting that attribute, you will have to
create a parser/decoder to populate your IDL type from that string.
Likewise, in the retrieval of that attribute, you will have to create a
encoder that will take the IDL type and convert it to a string.

I have attached the import PICML model using the IDL you specified
above. If you look in the ComponentImplementation folder, there is a
model named Example. I attached a string property to an attribute names
"Env_Workaround". The value has the encode "instance" you are refering
to which will be set on that component at deployment time.

HTH,

James
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Env.xme
Type: application/octet-stream
Size: 30488 bytes
Desc: Env.xme
Url : http://list.isis.vanderbilt.edu/pipermail/cosmic-users/attachments/20060422/f7dad50d/Env-0001.obj


More information about the cosmic-users mailing list