Adding doxygen style python module desgnation.

Adding another file to example that shows 2 files in same namespace.
This commit is contained in:
Alex Lin 2019-03-14 09:33:50 -05:00
parent 62948308b6
commit 41f151f2ee
4 changed files with 46 additions and 0 deletions

View File

@ -55,6 +55,9 @@ sub extract_trick_header($$$$) {
# save doxygen style trick_lib_dependency fields in field = liblist.
$header{liblist} = [@lib_list] ;
}
if ( $contents =~ /(?:@|\\)python_module\s*{\s*(.*?)\s*}/) {
$header{python_module} = $1;
}
$header{language} = "CPP" if ( $header{language} =~ /c[p\+]+/i ) ;

View File

@ -12,6 +12,7 @@ def main():
ball.foo_food.print_me()
ball.foo_inner_food.print_me()
ball.bar_food.print_me()
ball.foo_yummyfood.print_me()
print
# new class from Foo.Food
@ -35,6 +36,13 @@ def main():
bar.fast = trick.Bar.Burger
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__":
main()

View File

@ -8,6 +8,7 @@ PURPOSE:
##include "FooFood.hh"
##include "FooInnerFood.hh"
##include "BarFood.hh"
##include "FooYummyFood.hh"
class SimObj : public Trick::SimObject {
@ -15,6 +16,7 @@ class SimObj : public Trick::SimObject {
Foo::Food foo_food ;
Foo::Inner::Food foo_inner_food ;
Bar::Food bar_food ;
Foo::YummyFood foo_yummyfood ;
/** Constructor to add the jobs */
SimObj() {

View 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_ */