LinuxSampler::Thread Class Reference

Abstract base class for classes that need to run in an own thread. More...

#include <Thread.h>

Inheritance diagram for LinuxSampler::Thread:
LinuxSampler::InstrumentEditor

List of all members.

Public Member Functions

 Thread (bool LockMemory, bool RealTime, int PriorityMax, int PriorityDelta)
virtual ~Thread ()
virtual int StartThread ()
virtual int StopThread ()
virtual int SignalStartThread ()
virtual int SignalStopThread ()
void TestCancel ()
virtual bool IsRunning ()
virtual int SetSchedulingPriority ()
virtual int LockMemory ()
virtual void EnableDestructor ()
virtual int Destructor ()
virtual int Main ()=0
 This method needs to be implemented by the descendant and is the entry point for the new thread. FIXME: should be protected.

Static Public Member Functions

static void * allocAlignedMem (size_t boundary, size_t size)
 Allocates an aligned block of memory.
static void freeAlignedMem (void *ptr)
 Frees an aligned block of memory allocated with allocAlignedMem().
static bool lockMemory (void *addr, size_t size)
 Locks a region of memory in physical RAM.
static bool unlockMemory (void *addr, size_t size)
 Unlocks a region of memory in physical RAM.

Detailed Description

Abstract base class for classes that need to run in an own thread.

Definition at line 50 of file Thread.h.


Constructor & Destructor Documentation

LinuxSampler::Thread::Thread ( bool  LockMemory,
bool  RealTime,
int  PriorityMax,
int  PriorityDelta 
)
virtual LinuxSampler::Thread::~Thread (  )  [virtual]

Member Function Documentation

static void* LinuxSampler::Thread::allocAlignedMem ( size_t  boundary,
size_t  size 
) [inline, static]

Allocates an aligned block of memory.

Allocated memory blocks need to be freed using freeAlignedMem().

Parameters:
boundary - the alignement boundary, usually a power of 2 e.g. 4 but it can be an arbitrary number between 1 and 128
Parameters:
size - size in bytes to be allocated
Returns:
pointer to the allocated memory block

Definition at line 79 of file Thread.h.

Referenced by LinuxSampler::AudioChannel::AudioChannel().

virtual int LinuxSampler::Thread::Destructor (  )  [virtual]
virtual void LinuxSampler::Thread::EnableDestructor (  )  [virtual]
static void LinuxSampler::Thread::freeAlignedMem ( void *  ptr  )  [inline, static]

Frees an aligned block of memory allocated with allocAlignedMem().

Parameters:
ptr - pointer to the memory block

Definition at line 91 of file Thread.h.

virtual bool LinuxSampler::Thread::IsRunning (  )  [virtual]
static bool LinuxSampler::Thread::lockMemory ( void *  addr,
size_t  size 
) [inline, static]

Locks a region of memory in physical RAM.

Parameters:
addr - address of the memory block
Parameters:
size - size of the memory block
Returns:
true if the locking succeded, otherwise false

Definition at line 104 of file Thread.h.

virtual int LinuxSampler::Thread::LockMemory (  )  [virtual]
virtual int LinuxSampler::Thread::Main (  )  [pure virtual]

This method needs to be implemented by the descendant and is the entry point for the new thread. FIXME: should be protected.

Implemented in LinuxSampler::InstrumentEditor.

virtual int LinuxSampler::Thread::SetSchedulingPriority (  )  [virtual]
virtual int LinuxSampler::Thread::SignalStartThread (  )  [virtual]
virtual int LinuxSampler::Thread::SignalStopThread (  )  [virtual]
virtual int LinuxSampler::Thread::StartThread (  )  [virtual]
virtual int LinuxSampler::Thread::StopThread (  )  [virtual]
void LinuxSampler::Thread::TestCancel (  )  [inline]

Definition at line 56 of file Thread.h.

static bool LinuxSampler::Thread::unlockMemory ( void *  addr,
size_t  size 
) [inline, static]

Unlocks a region of memory in physical RAM.

Parameters:
addr - address of the memory block
Parameters:
size - size of the memory block
Returns:
true if the unlocking succeded, otherwise false

Definition at line 119 of file Thread.h.


The documentation for this class was generated from the following file:
Generated on Sat Jan 28 11:44:02 2012 for linuxsampler by  doxygen 1.6.3