Implementation details must be added to the ``Impl'' files generated in Subsection 7.4.1. Changes to these files must be made between code splicer pairs to ensure their retention in subsequent invocations of Babel. Below is an example of a code splicer pair in C++. The actual implementation needs to replace the ``// Insert code here...'' line.
void MyPackage::MyClass_impl::myMethod_impl() { // DO-NOT-DELETE splicer.begin(MyPackage.MyClass.myMethod) // Insert code here... // DO-NOT-DELETE splicer.end(MyPackage.MyClass.myMethod) }
It is important to understand where and why splicer blocks occur. Splicer blocks appear at the beginning and end of each ``Impl'' header and source file to allow developers to add #include's and other miscellaneous items, respectively. In the headers, there is a splicer block that allows a user to make the ``Impl'' class inherit from some other class. From SIDL's point of view this is private inheritance -- meaning that it is useful for inheriting implementation details -- since they cannot be automatically exposed to the SIDL method dispatch mechanism. There is a splicer block inside the class definition for developers to add any desired data members. In the source files, splicer blocks appear in each method implementation. Examples of filling in these splicer blocks are provided in the subsections to follow.