Using C++ with DSP/BIOS
2-30
Example 2-6.
Wrapper Function for a Class Method
Any additional parameters that the class method requires can be passed to
the wrapper function.
2.9.4
Class Constructors and Destructors
Any time that a C++ class object is instantiated, the class constructor
executes. Likewise, any time that a class object is deleted, the class
destructor is called. Therefore, when writing constructors and destructors,
you should consider the times at which the functions are expected to execute
and tailor them accordingly. It is important to consider what type of thread will
be running when the class constructor or destructor is invoked.
Various guidelines apply to which DSP/BIOS API functions can be called
from different DSP/BIOS threads (tasks, software interrupts, and hardware
interrupts). For example, memory allocation APIs such as MEM_alloc and
MEM_calloc cannot be called from within the context of a software interrupt.
Thus, if a particular class is instantiated by a software interrupt, its constructor
must avoid performing memory allocation. Similarly, it is important to keep in
mind the time at which a class destructor is expected to run. Not only does a
class destructor execute when an object is explicitly deleted, but also when a
local object goes out of scope. You need to be aware of what type of thread
is executing when the class destructor is called and make only those
DSP/BIOS API calls that are appropriate for that thread. For further
information on function callability, see the
TMS320 DSP/BIOS API Reference
Guide
for your platform.
Void wrapper (SampleClass myObject)
{
myObject->method();
}
Содержание TMS320 Series
Страница 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Страница 16: ...xvi ...
Страница 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Страница 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Страница 202: ...5 20 ...
Страница 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Страница 288: ...Index 10 Index ...