Baigudin Software avatar
Baigudin Software logo
home
ru region
en region

Abstract class «eoos::lib::AbstractThreadTask<A>»

Abstract thread with a task.

public: AbstractThreadTask();

Constructor.

public: virtual ~AbstractThreadTask();

Destructor.

public: virtual bool_t execute();

Causes this thread to begin execution.

Returns:
True if execution of the thread initiated successfully.

public: virtual int32_t getPriority() const;

Returns this thread priority.

Returns:
Priority value, or PRIORITY_WRONG if an error has been occurred.

public: virtual size_t getStackSize() const;

Returns size of stack.

The function returns size of stack in bytes which should be allocated for the task.

Returns:
Stack size in bytes, or zero if OS default stack size is needed.

public: virtual bool_t isConstructed() const;

Tests if this object has been constructed.

Returns:
True if object has been constructed successfully.

public: static bool_t isConstructed(api::Object* obj);

Tests if an object has been constructed.

Parameters:
obj — Object to be tested.

Returns:
True if object has been constructed successfully.

public: virtual bool_t join();

Waits for this thread to die.

Returns:
True, if this thread is dead.

public: static void operator delete(void* ptr);

Operator delete.

Parameters:
ptr — An address of allocated memory block or a null pointer.

public: static void operator delete(void*, void*);

Operator delete.

public: static void* operator new(size_t size);

Operator new.

Parameters:
size — A number of bytes to allocate.

Returns:
Allocated memory address or a null pointer.

public: static void* operator new(size_t, void* ptr);

Operator new.

Parameters:
ptr — A pointer to reserved memory area.

Returns:
The given pointer.

public: Object& operator=(Object const& obj);

Copy assignment operator.

Parameters:
obj — Reference to a source object.

Returns:
Reference to this object.

public: Object& operator=(Object&& obj) & noexcept;

Move assignment operator.

Parameters:
obj — Right reference to a source object.

Returns:
Reference to this object.

public: virtual bool_t setPriority(int32_t priority);

Sets this thread priority.

Parameters:
priority — Number of priority in range [PRIORITY_MIN, PRIORITY_MAX], or PRIORITY_LOCK.

Returns:
True if priority is set.

public: static bool_t sleep(int32_t ms);

Causes current thread to sleep.

Parameters:
ms — A time to sleep in milliseconds.

Returns:
true if thread slept requested time.

public: virtual void start();

Starts executing an operating system task in itself context.

public: static void yield();

Yields to next thread.

Back to class list