Book contents
- Frontmatter
- Contents
- Preface
- List of abbreviations
- Part I Preparation for OPNET Modeling
- Part II Modeling Custom Networks and Protocols
- Part III Modeling and Modifying Standard Networks and Protocols
- Part IV OPNET Modeling Facilities
- 11 Debugging simulation
- 12 OPNET programming in C++
- 13 Traffic in OPNET simulation
- 14 External model access (EMA)
- 15 OPNET co-simulation with third-party programs
- 16 Model authoring and security
- References
- Index
12 - OPNET programming in C++
from Part IV - OPNET Modeling Facilities
Published online by Cambridge University Press: 05 February 2012
- Frontmatter
- Contents
- Preface
- List of abbreviations
- Part I Preparation for OPNET Modeling
- Part II Modeling Custom Networks and Protocols
- Part III Modeling and Modifying Standard Networks and Protocols
- Part IV OPNET Modeling Facilities
- 11 Debugging simulation
- 12 OPNET programming in C++
- 13 Traffic in OPNET simulation
- 14 External model access (EMA)
- 15 OPNET co-simulation with third-party programs
- 16 Model authoring and security
- References
- Index
Summary
This chapter briefly describes the differences between Proto-C, C, and C++ languages and shows how to configure OPNET to program models in C++. A case study is also provided to help the reader grasp the important points on programming OPNET models in C++. If you are intending to program only in C style, this chapter can be ignored. If you are familiar with C++ and are interested in programming models in object-oriented C++ style, you may read this chapter. The chapter requires basic knowledge of generic C++ programming.
Proto-C, C, and C++: language and library differences
OPNET provides a programming language called Proto-C to allow users to model various systems. Proto-C preserves generality by incorporating all the capabilities of the C/C++ programming language, i.e., a user can program in Proto-C in a similar way to in C/C++, and in Proto-C you can use the libraries that are accessible to C/C++ as well. On the other hand, Proto-C provides a set of its own APIs to model communication networks. Proto-C supports modeling with the state transition diagram (STD) method, which makes it possible to accurately describe most systems. Figure 12.1 shows that Proto-C allows you to use both C/C++ and Proto-C libraries and write models in both C and C++ styles.
- Type
- Chapter
- Information
- Unlocking the Power of OPNET Modeler , pp. 182 - 193Publisher: Cambridge University PressPrint publication year: 2012