Book contents
- Frontmatter
- Contents
- Preface
- List of abbreviations
- Part I Preparation for OPNET Modeling
- Part II Modeling Custom Networks and Protocols
- 4 OPNET programming interfaces
- 5 Creating and simulating custom models using OPNET APIs
- 6 High-level wrapper APIs
- 7 Modeling with high-level wrapper APIs
- Part III Modeling and Modifying Standard Networks and Protocols
- Part IV OPNET Modeling Facilities
- References
- Index
6 - High-level wrapper APIs
from Part II - Modeling Custom Networks and Protocols
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
- 4 OPNET programming interfaces
- 5 Creating and simulating custom models using OPNET APIs
- 6 High-level wrapper APIs
- 7 Modeling with high-level wrapper APIs
- Part III Modeling and Modifying Standard Networks and Protocols
- Part IV OPNET Modeling Facilities
- References
- Index
Summary
This chapter demonstrates how to write your own high-level wrapper APIs which encapsulate many OPNET programming details, in order to facilitate and accelerate design and programming of OPNET models. We also provide several wrapper API packages to help users to quickly build their models. To be able to follow this chapter, you are assumed to know how to write custom models as shown in Chapter 5, and the basics of generic programming.
Why and how to use wrapper APIs
When creating a simulation model, one often needs to repetitively write code with some similar functionalities. To speed up modeling and coding, one can write some wrapper functions that implement those commonly used functionalities. These wrapper functions will save modeling time and reduce the chances of making errors. Wrapper APIs here refer to the functions that encapsulate many programming details and implement particular functionalities at higher level. Figure 6.1 shows an example of a wrapper API that is defined in a header file called “geo_topo.h”, which can be downloaded from the publisher's website.
Figure 6.1 shows that a wrapper API is simply a function that wraps some functionalities and provides a higher-level interface. To use the wrapper APIs in the process model, one needs to include the header file containing the APIs. By default, OPNET Modeler will look for header files in its installation path and in model paths.
- Type
- Chapter
- Information
- Unlocking the Power of OPNET Modeler , pp. 100 - 109Publisher: Cambridge University PressPrint publication year: 2012