Note: The content in this series is extracted from the
book, Introduction to Network Simulator NS2. You may have to read chapter 3 of the
book for better understanding.
Introduction
This post is the second post in the series on C++ and OTcl Linkage:
1. Why Two Languages?
2. Binding C++ and OTcl classes [Main steps, The mechanism].
3. Variable binding
4. OTcl command: Invoking C++ statements from the OTcl domain
5. Eval and result: Invoking OTcl statements from the C++ domain
6. Object binding and object construction process.
In the
previous post, I blogged about the motivation of having 2 languages. In this post, I will show you how to bind a C++ class to an OTcl class so that when an OTcl object is created, a shadowed C++ object is automatically crated.