Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » DSDP - Real-Time Software Components (RTSC) » private attributes in Build.platformTable
private attributes in Build.platformTable [message #1058] Tue, 10 February 2009 23:08 Go to next message
Ramsey Harris is currently offline Ramsey HarrisFriend
Messages: 22
Registered: July 2009
Junior Member
Champs,

Is it allowed to add my own private attributes to a platform instance in
Build.platformTable or can I only use instance create parameters?

For example, I would like to add the Linux kernel directory to my
platform instance for use by my test package build script.

Build.platformTable["ti.platforms.evmDM6446:Linux_2.6.28"] = {
kernelDir: "path/to/my/kernel/linux-2.6.28"
}

Thanks
~ Ramsey
Re: private attributes in Build.platformTable [message #1086 is a reply to message #1058] Wed, 11 February 2009 02:33 Go to previous messageGo to next message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
Ramsey Harris wrote:
> Champs,
>
> Is it allowed to add my own private attributes to a platform instance in
> Build.platformTable or can I only use instance create parameters?
>
> For example, I would like to add the Linux kernel directory to my
> platform instance for use by my test package build script.
>
> Build.platformTable["ti.platforms.evmDM6446:Linux_2.6.28"] = {
> kernelDir: "path/to/my/kernel/linux-2.6.28"
> }
>
> Thanks
> ~ Ramsey
Not really. You can add anything you want to the platformTable but the
only instance fields that you can access after the platform instance is
created are those instance fields defined by the
ti.platforms.evmDM6446.Platform module.

However, this module _could_ provide the arguments passed in the
platformTable as an instance parameter. But this would be
platform-specific.
Re: private attributes in Build.platformTable [message #1114 is a reply to message #1086] Wed, 11 February 2009 16:54 Go to previous messageGo to next message
Ramsey Harris is currently offline Ramsey HarrisFriend
Messages: 22
Registered: July 2009
Junior Member
dave russo wrote:
> Ramsey Harris wrote:
>> Champs,
>>
>> Is it allowed to add my own private attributes to a platform instance
>> in Build.platformTable or can I only use instance create parameters?
>>
>> For example, I would like to add the Linux kernel directory to my
>> platform instance for use by my test package build script.
>>
>> Build.platformTable["ti.platforms.evmDM6446:Linux_2.6.28"] = {
>> kernelDir: "path/to/my/kernel/linux-2.6.28"
>> }
>>
>> Thanks
>> ~ Ramsey
> Not really. You can add anything you want to the platformTable but the
> only instance fields that you can access after the platform instance is
> created are those instance fields defined by the
> ti.platforms.evmDM6446.Platform module.
>
> However, this module _could_ provide the arguments passed in the
> platformTable as an instance parameter. But this would be
> platform-specific.

All right, I understand that the platform instance will only see the properties defined by the platform module. What I would like to do is add private properties in the platformTable which a package build script would use at build time. I just want to confirm that doing this would not cause a problem when creating the platform instance. I don't need access to the private properties in the platform instance, just in the package build script. Is this allowed?
Re: private attributes in Build.platformTable [message #1140 is a reply to message #1114] Wed, 11 February 2009 19:32 Go to previous messageGo to next message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
Ramsey Harris wrote:
>> Not really. You can add anything you want to the platformTable but
>> the only instance fields that you can access after the platform
>> instance is created are those instance fields defined by the
>> ti.platforms.evmDM6446.Platform module.
>>
>> However, this module _could_ provide the arguments passed in the
>> platformTable as an instance parameter. But this would be
>> platform-specific.
>
> All right, I understand that the platform instance will only see the
> properties defined by the platform module. What I would like to do is
> add private properties in the platformTable which a package build script
> would use at build time. I just want to confirm that doing this would
> not cause a problem when creating the platform instance. I don't need
> access to the private properties in the platform instance, just in the
> package build script. Is this allowed?
The current implementation explicitly removes properties not declared by
the Platform module _before_ creating the Platform instance. So .. it
will work.

However, others might argue that we should be generating an error for
these properties rather than silently "fixing" the object. Suppose, for
example, that you simply misspell a platform's instance creation
parameter. Without an error message, you will be pulling your hair out
trying to understand why the platform is not doing what you want.

If it weren't for backward compatibility, I'd fix the current
implementation to generate an error. In a future release when we have
some flexibility w.r.t. compatibility, we might implement this fix.
Re: private attributes in Build.platformTable [message #1168 is a reply to message #1140] Wed, 11 February 2009 20:01 Go to previous message
Ramsey Harris is currently offline Ramsey HarrisFriend
Messages: 22
Registered: July 2009
Junior Member
dave russo wrote:
> The current implementation explicitly removes properties not declared by
> the Platform module _before_ creating the Platform instance. So .. it
> will work.
>
> However, others might argue that we should be generating an error for
> these properties rather than silently "fixing" the object. Suppose, for
> example, that you simply misspell a platform's instance creation
> parameter. Without an error message, you will be pulling your hair out
> trying to understand why the platform is not doing what you want.
>
> If it weren't for backward compatibility, I'd fix the current
> implementation to generate an error. In a future release when we have
> some flexibility w.r.t. compatibility, we might implement this fix.

Okay, I will not add my private properties to the platformTable object as this will likely break in the future. I'm glad I asked. Thanks.
Previous Topic:Package dependencies
Next Topic:Changing library suffix
Goto Forum:
  


Current Time: Tue Apr 23 07:27:22 GMT 2024

Powered by FUDForum. Page generated in 0.03462 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top