mirror of
https://github.com/nasa/trick.git
synced 2025-05-29 13:44:30 +00:00
Adding doxygen style python module desgnation.
Adding another file to example that shows 2 files in same namespace.
This commit is contained in:
parent
62948308b6
commit
41f151f2ee
@ -55,6 +55,9 @@ sub extract_trick_header($$$$) {
|
|||||||
# save doxygen style trick_lib_dependency fields in field = liblist.
|
# save doxygen style trick_lib_dependency fields in field = liblist.
|
||||||
$header{liblist} = [@lib_list] ;
|
$header{liblist} = [@lib_list] ;
|
||||||
}
|
}
|
||||||
|
if ( $contents =~ /(?:@|\\)python_module\s*{\s*(.*?)\s*}/) {
|
||||||
|
$header{python_module} = $1;
|
||||||
|
}
|
||||||
|
|
||||||
$header{language} = "CPP" if ( $header{language} =~ /c[p\+]+/i ) ;
|
$header{language} = "CPP" if ( $header{language} =~ /c[p\+]+/i ) ;
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ def main():
|
|||||||
ball.foo_food.print_me()
|
ball.foo_food.print_me()
|
||||||
ball.foo_inner_food.print_me()
|
ball.foo_inner_food.print_me()
|
||||||
ball.bar_food.print_me()
|
ball.bar_food.print_me()
|
||||||
|
ball.foo_yummyfood.print_me()
|
||||||
print
|
print
|
||||||
|
|
||||||
# new class from Foo.Food
|
# new class from Foo.Food
|
||||||
@ -35,6 +36,13 @@ def main():
|
|||||||
bar.fast = trick.Bar.Burger
|
bar.fast = trick.Bar.Burger
|
||||||
TRICK_EXPECT_EQ( bar.fast , 1, test_suite , "another first level python namespace" )
|
TRICK_EXPECT_EQ( bar.fast , 1, test_suite , "another first level python namespace" )
|
||||||
|
|
||||||
|
# new class from Foo.Food.Inner
|
||||||
|
yummy = trick.Foo.YummyFood()
|
||||||
|
yummy.print_me()
|
||||||
|
TRICK_EXPECT_EQ( yummy.yummy , 1, test_suite , "additional file in same namespace" )
|
||||||
|
yummy.yummy = trick.Foo.Doughnuts
|
||||||
|
TRICK_EXPECT_EQ( yummy.yummy , 2, test_suite , "additional file in same namespace" )
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ PURPOSE:
|
|||||||
##include "FooFood.hh"
|
##include "FooFood.hh"
|
||||||
##include "FooInnerFood.hh"
|
##include "FooInnerFood.hh"
|
||||||
##include "BarFood.hh"
|
##include "BarFood.hh"
|
||||||
|
##include "FooYummyFood.hh"
|
||||||
|
|
||||||
class SimObj : public Trick::SimObject {
|
class SimObj : public Trick::SimObject {
|
||||||
|
|
||||||
@ -15,6 +16,7 @@ class SimObj : public Trick::SimObject {
|
|||||||
Foo::Food foo_food ;
|
Foo::Food foo_food ;
|
||||||
Foo::Inner::Food foo_inner_food ;
|
Foo::Inner::Food foo_inner_food ;
|
||||||
Bar::Food bar_food ;
|
Bar::Food bar_food ;
|
||||||
|
Foo::YummyFood foo_yummyfood ;
|
||||||
|
|
||||||
/** Constructor to add the jobs */
|
/** Constructor to add the jobs */
|
||||||
SimObj() {
|
SimObj() {
|
||||||
|
33
test/SIM_python_namespace/models/FooYummyFood.hh
Normal file
33
test/SIM_python_namespace/models/FooYummyFood.hh
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/**
|
||||||
|
@file
|
||||||
|
|
||||||
|
@verbatim
|
||||||
|
PURPOSE: (Namespace Test)
|
||||||
|
PYTHON_MODULE: (Foo)
|
||||||
|
@endverbatim
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#ifndef FOOYUMMYFOOD_HH
|
||||||
|
#define FOOYUMMYFOOD_HH
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
namespace Foo {
|
||||||
|
|
||||||
|
enum Yummy {
|
||||||
|
Butter,
|
||||||
|
Bacon,
|
||||||
|
Doughnuts
|
||||||
|
};
|
||||||
|
|
||||||
|
class YummyFood {
|
||||||
|
public:
|
||||||
|
YummyFood() : yummy(Bacon) {}
|
||||||
|
void print_me() { std::cout << "Foo::YummyFood::print_me!" << std::endl; }
|
||||||
|
Yummy yummy;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _BALL_HH_ */
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user