Commit b26b4708 authored by yoogx's avatar yoogx
Browse files

* Import a first example of C++ integration

parent cc7121d0
......@@ -182,6 +182,7 @@ AC_OUTPUT([
examples/aadlv1/rma/Makefile
examples/aadlv1/sunseeker/Makefile
examples/aadlv2/Makefile
examples/aadlv2/cpp/Makefile
examples/aadlv2/d3.1.3-1/Makefile
examples/aadlv2/import/Makefile
examples/aadlv2/ping/Makefile
......
SUBDIRS = d3.1.3-1 ping rma sunseeker producer-consumer some-types \
some-types-stdint flight-mgmt import monitor packet-store file-store lua
some-types-stdint flight-mgmt import monitor packet-store \
file-store lua cpp
SAMPLE_DIR = ${shell $(CYGPATH_U) '$(OCARINA_PREFIX)/examples/ocarina/polyorb-hi-c/aadlv2'}
......
C_FILES = $(srcdir)/hello.cc
AADL_FILES = $(srcdir)/cpp_test.aadl
SCENARIO_FILES = $(srcdir)/scenario.aadl
include $(srcdir)/../../Makefile.common
EXTRA_DIST = $(AADL_FILES) $(SCENARIO_FILES) $(C_FILES)
CLEANDIRS = cpp_test_impl
package CPP_Test
public
with Deployment;
-----------------
-- Subprograms --
-----------------
subprogram Hello_Spg_1
properties
source_language => (CPP);
source_name => "hello_world";
source_text => ("hello.cc");
end Hello_Spg_1;
-------------
-- Threads --
-------------
thread Task
end Task;
thread implementation Task.impl_1
calls
Mycalls: {
P_Spg : subprogram Hello_Spg_1;
};
properties
Dispatch_Protocol => periodic;
Period => 1000ms;
end Task.impl_1;
---------------
-- Processor --
---------------
processor cpurm
properties
Deployment::Execution_Platform => Native;
end cpurm;
processor implementation cpurm.impl
properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
end cpurm.impl;
---------------
-- Processes --
---------------
process node_a
end node_a;
process implementation node_a.impl
subcomponents
Task1 : thread Task.impl_1;
end node_a.impl;
------------
-- System --
------------
system cpp_test
end cpp_test;
system implementation cpp_test.impl
subcomponents
node_a : process node_a.impl;
cpu_rm : processor cpurm.impl;
properties
Actual_Processor_Binding => (reference (cpu_rm)) applies to node_a;
end cpp_test.impl;
end CPP_Test;
#ifdef __cplusplus
extern "C" {
void hello_world (void);
}
#endif
#include<iostream>
void hello_world (void)
{
std::cout << "Hello, new world!\n";
}
system cpp
properties
Ocarina_Config::AADL_Files =>
("cpp_test.aadl");
Ocarina_Config::Generator => polyorb_hi_c;
Ocarina_Config::Needed_Property_Sets =>
(value (Ocarina_Config::Data_Model),
value (Ocarina_Config::Deployment),
value (Ocarina_Config::Cheddar_Properties));
Ocarina_Config::AADL_Version => AADLv2;
end cpp;
system implementation cpp.Impl
end cpp.Impl;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment