Classes | Defines

C:/Documents and Settings/gw/My Documents/Other projects/flightos/Core/module.h File Reference

#include "common.h"
#include "array.h"

Go to the source code of this file.

Classes

struct  SOCKETRECORD
 A reference to a socket. More...
class  SocketArray
 Array of sockets. More...
class  Module
 The base class for all modules. More...

Defines

#define MAX_MODULES   20
#define DECLARE_MODULE(Name, Parent)
#define MAX_THREADS   6
#define PRIORITY_NEVER   -1

Define Documentation

#define DECLARE_MODULE (   Name,
  Parent 
)
Value:
public:\
    virtual const char * GetName(){return(#Name);}\
    virtual void PrintName(HardwareSerial& port){\
      port.print(#Name);\
      port.print(".");\
      Parent::PrintName(port);}

Declare a module.

Name is the class name, Parent is the parent class. For exmaple:

class FooClass: public Module
{
DECLARE_MODULE(FooClass,Module)
  FooClass(){only add sockets and the bare minimum of initialization here}
  Init(){Initialize here}
  Loop{This is called on a regular basis}
}
#define MAX_MODULES   20
#define MAX_THREADS   6
#define PRIORITY_NEVER   -1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines