Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » DSDP - Real-Time Software Components (RTSC) » nested packages
nested packages [message #705254] Fri, 29 July 2011 16:16 Go to next message
Patrick Geremia is currently offline Patrick GeremiaFriend
Messages: 79
Registered: July 2009
Member
Suppose I have package A and package B.
I would like to have package C as a container package. Package C will
basically will a wrapper package for A and B

ti.packageC
ti.packageC.packageA
ti.packageC.packageB

packageA has packageA.h as interface
packageB has packageB.h as interface

I assume that if I write as below, I will pull in packageA and packageB
if a package requires packageC.

- I write packageC.h to include ti/packageA.h and ti/packageB.h
- I write packageC.xdc with requires statements for ti.packageA and
ti.packageB

Can you confirm?

Regards
Patrick Geremia
Re: nested packages [message #705301 is a reply to message #705254] Fri, 29 July 2011 17:20 Go to previous messageGo to next message
Sasha Slijepcevic is currently offline Sasha SlijepcevicFriend
Messages: 115
Registered: July 2009
Senior Member
Sharing a part of the qualified package name does not imply any specific relation between packages. Therefore, it does not matter if packageA and packageB are located as subdirectories of the base directory for packageC.
If you specify in package.xdc for packageC that packageA and packageB are required, they will be loaded when packageC is loaded. As for header files, are you talking about generated header files for modules and interfaces from packageC? These files will include header files for other modules referenced in the packageC's module specifications.
Re: nested packages [message #705345 is a reply to message #705254] Fri, 29 July 2011 18:46 Go to previous messageGo to next message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
RTSC consistently uses the package path exclusively to locate all files;
C headers, JavaScript files, libraries, ... In addition, all references
consistently use the package name prefix to ensure files with the same
base name in two different packages are never confused.

So, C sources that #include <ti/packageC/packageA/package.h> will
include the first file named 'ti/packageC/packageA/package.h' found by
successively appending this name to each directory appearing in the
package path.

Since packages can be installed and found in any directory on the
package path, the fact that a package shares a common prefix does not
imply any "container" relationship between the two. For example, if you
build a release of pkgC, the package pkgC's archive will _not_ contain
pkgA of pkgB. The package name is mostly just a namespace.

'requires' statements do not affect the package path. The 'requires'
declaration affects
1. whether a package's libraries will be added to the list of
libraries to link with; if pkgA requires pkgC and your app
uses pkgA, pkgC's libraries will be automatically added
to the generated linker command file
2. the ordering of libraries in the the generated linker command
files; if pkgA requires pkgB, pkgB's library is linked after
pkgA's library
3. the order in which packages are built by the xdc tool (when
using -PD option)


On 7/29/2011 9:16 AM, Patrick Geremia wrote:
> Suppose I have package A and package B.
> I would like to have package C as a container package. Package C will
> basically will a wrapper package for A and B
>
> ti.packageC
> ti.packageC.packageA
> ti.packageC.packageB
>
> packageA has packageA.h as interface
> packageB has packageB.h as interface
>
> I assume that if I write as below, I will pull in packageA and packageB
> if a package requires packageC.
>
> - I write packageC.h to include ti/packageA.h and ti/packageB.h
> - I write packageC.xdc with requires statements for ti.packageA and
> ti.packageB
>
> Can you confirm?
>
> Regards
> Patrick Geremia
>
Re: nested packages [message #707103 is a reply to message #705301] Mon, 01 August 2011 08:41 Go to previous messageGo to next message
Patrick Geremia is currently offline Patrick GeremiaFriend
Messages: 79
Registered: July 2009
Member
Thanks for the information.

>> As for header
>> files, are you talking about generated header files for modules and
>> interfaces from packageC? These files will include header files for
>> other modules referenced in the packageC's module specifications.

No I was not talking about generated files for interfaces.
I am aware that I will to manually include packageA and packageB in
files from packageC.


Sasha Slijepcevic wrote:
> Sharing a part of the qualified package name does not imply any specific
> relation between packages. Therefore, it does not matter if packageA and
> packageB are located as subdirectories of the base directory for packageC.
> If you specify in package.xdc for packageC that packageA and packageB
> are required, they will be loaded when packageC is loaded. As for header
> files, are you talking about generated header files for modules and
> interfaces from packageC? These files will include header files for
> other modules referenced in the packageC's module specifications.
>
Re: nested packages [message #707104 is a reply to message #705345] Mon, 01 August 2011 08:43 Go to previous message
Patrick Geremia is currently offline Patrick GeremiaFriend
Messages: 79
Registered: July 2009
Member
Understood. Thanks.

dave russo wrote:
> RTSC consistently uses the package path exclusively to locate all files;
> C headers, JavaScript files, libraries, ... In addition, all references
> consistently use the package name prefix to ensure files with the same
> base name in two different packages are never confused.
>
> So, C sources that #include <ti/packageC/packageA/package.h> will
> include the first file named 'ti/packageC/packageA/package.h' found by
> successively appending this name to each directory appearing in the
> package path.
>
> Since packages can be installed and found in any directory on the
> package path, the fact that a package shares a common prefix does not
> imply any "container" relationship between the two. For example, if you
> build a release of pkgC, the package pkgC's archive will _not_ contain
> pkgA of pkgB. The package name is mostly just a namespace.
>
> 'requires' statements do not affect the package path. The 'requires'
> declaration affects
> 1. whether a package's libraries will be added to the list of
> libraries to link with; if pkgA requires pkgC and your app
> uses pkgA, pkgC's libraries will be automatically added
> to the generated linker command file
> 2. the ordering of libraries in the the generated linker command
> files; if pkgA requires pkgB, pkgB's library is linked after
> pkgA's library
> 3. the order in which packages are built by the xdc tool (when
> using -PD option)
>
>
> On 7/29/2011 9:16 AM, Patrick Geremia wrote:
>> Suppose I have package A and package B.
>> I would like to have package C as a container package. Package C will
>> basically will a wrapper package for A and B
>>
>> ti.packageC
>> ti.packageC.packageA
>> ti.packageC.packageB
>>
>> packageA has packageA.h as interface
>> packageB has packageB.h as interface
>>
>> I assume that if I write as below, I will pull in packageA and packageB
>> if a package requires packageC.
>>
>> - I write packageC.h to include ti/packageA.h and ti/packageB.h
>> - I write packageC.xdc with requires statements for ti.packageA and
>> ti.packageB
>>
>> Can you confirm?
>>
>> Regards
>> Patrick Geremia
>>
Previous Topic:Packed structures using XDC
Next Topic:Software Engineering tools
Goto Forum:
  


Current Time: Fri Apr 19 02:52:49 GMT 2024

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

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

Back to the top