Title: This application note is based on the work held by Ankur Agarwal at Computer Science and Engineering Florida Atlantic University Boca Raton, FL-33486
1This application note is based on the work
heldby Ankur Agarwalat Computer Science and
Engineering Florida Atlantic UniversityBoca
Raton, FL-33486
Multi threads Producer Consumer
application with Envision UML-Cby
CASE-France and Future Tech System Technical
contact Jean-Claude Jacquiot
2Forewords
This is a full threads running Windows
application using Producer Consumer project
- Comment about the demo
- This package includes a running threads Windows
demo, based on the Producer Consumer project. - The demo has been generated with UML-C from UML
diagrams shown in the following pages. Code has
been compiled with Microsoft Visual C compiler
using MFC Windows library for the Windows users
interface. - To run the demo, decompress the cpppc.zip file in
a temp directory, then double click on
producer.exe. Click on the button to start the
demo then watch and wait until it finishes. It
should run OK. Please let me know otherwise.
3Components view
- A physical design was chosen based on the
component view - This design implies classes are generated in
three bodies .cpp files and headers placed in
three .h files.
4Logical view
Producer and Consumer class contain a threaded
updateX() States machine operation
5Producer classStates/Transitions diagram
6Consumer classStates/Transitions diagram
7Code generated
- A directory including 3 bodies files (.cpp) with
corresponding headers files (.h) have been
generated according to component view - A log file containing generation steps with
various details, errors and warnings has also
been produced.
8Code generated files structure
- ProducerConsumer directory was created including
- MicrosoftCppMFCClassLibComponent.cpp was created
- MicrosoftCppMFCClassLibComponent.h
- ProducerConsumer.cpp was created
- ProducerConsumer.h was created
- ProviderConsumer.cpp was created
- ProducerConsumer.log steps generation log file
was created - Attached to this presentation and compressed in
the cpppc.zip file are the C source files, the
project log file (ASCII), the executable
Producer.exe and Microsoft DLLs to run the
embedded Windows interface.
9Conclusion
- The running code faithfully represents
assumptions made in UML diagrams with respect to
requirements. - The code generated was compiled successfully with
Microsoft Visual Studio C compiler NO ERROR
and runs fine on Windows XP or 2K systems. - Producer thread code can access Consumers data
and Consumer thread code can access Producers
data. - No difficulty what so ever during code generation
which takes less than a second.
10Thank you
- Please fell free to call for more information
- http//www.case-france.com
- Jean-claude.jacquiot_at_case-france.com
- lstucki_at_future-tech.com