mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
This is the changes made by Patrick Plenefisch converting the native code to use CMake and the CMake Maven Plugin, as opposed to the native Maven plugin. This is to allow for compatibility with newer versions of the GCC toolchain. All the cpp sources were moved from maven style directories to cpp style directories for CMake. Change-Id: I67f5e3608948f37c83b0990d232105a3784f8593
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
/*----------------------------------------------------------------------------*/
|
|
/* Copyright (c) FIRST 2008. All Rights Reserved. */
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
#ifndef __TASK_H__
|
|
#define __TASK_H__
|
|
|
|
#include "ErrorBase.h"
|
|
#include "HAL/HAL.h"
|
|
|
|
/**
|
|
* WPI task is a wrapper for the native Task object.
|
|
* All WPILib tasks are managed by a static task manager for simplified cleanup.
|
|
**/
|
|
class Task : public ErrorBase
|
|
{
|
|
public:
|
|
static const uint32_t kDefaultPriority = 101;
|
|
|
|
Task(const char* name, FUNCPTR function, int32_t priority = kDefaultPriority, uint32_t stackSize = 20000);
|
|
virtual ~Task();
|
|
|
|
bool Start(uint32_t arg0 = 0, uint32_t arg1 = 0, uint32_t arg2 = 0, uint32_t arg3 = 0, uint32_t arg4 = 0,
|
|
uint32_t arg5 = 0, uint32_t arg6 = 0, uint32_t arg7 = 0, uint32_t arg8 = 0, uint32_t arg9 = 0);
|
|
bool Restart();
|
|
bool Stop();
|
|
|
|
bool IsReady();
|
|
bool IsSuspended();
|
|
|
|
bool Suspend();
|
|
bool Resume();
|
|
|
|
bool Verify();
|
|
|
|
int32_t GetPriority();
|
|
bool SetPriority(int32_t priority);
|
|
const char* GetName();
|
|
TASK GetID();
|
|
|
|
private:
|
|
FUNCPTR m_function;
|
|
char* m_taskName;
|
|
TASK m_taskID;
|
|
uint32_t m_stackSize;
|
|
int m_priority;
|
|
bool HandleError(STATUS results);
|
|
DISALLOW_COPY_AND_ASSIGN(Task);
|
|
};
|
|
|
|
#endif // __TASK_H__
|