All pastes #445342 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-17 20:29 UTC
rendered paste body
#ifndef RTSC_H
#define RTSC_H

#include <glib.h>

#define RTSC_CLASS_Statechart       "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeStatechart"
#define RTSC_CLASS_StartState       "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeStartState"
#define RTSC_CLASS_StopState        "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeStopState"
#define RTSC_CLASS_State            "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLComplexRealtimeState"
#define RTSC_CLASS_Transition       "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeTransition"
#define RTSC_CLASS_Action           "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeAction"
#define RTSC_CLASS_Event            "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeEvent"

#define RTSC_NAME_IsTopStatechart   "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeStatechart::isTopStatechart"
#define RTSC_NAME_State             "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeStatechart::uMLRealtimeState"
#define RTSC_NAME_StartState        "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeStatechart::uMLRealtimeStartState"
#define RTSC_NAME_Transition        "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeStatechart::uMLRealtimeTransition"
#define RTSC_NAME_TransitionIn      "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeState::uMLRealtimeTransition1"
#define RTSC_NAME_TransitionOut     "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeState::uMLRealtimeTransition"
#define RTSC_NAME_Statechart        "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeState::uMLRealtimeStatechart"
#define RTSC_NAME_Name              "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeState::name"
#define RTSC_NAME_StateFrom         "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeTransition::uMLRealtimeState1"
#define RTSC_NAME_StateTo           "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeTransition::uMLRealtimeState"
#define RTSC_NAME_StatechartTrans   "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeTransition::uMLRealtimeStatechart"
#define RTSC_NAME_NameTrans         "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeTransition::name"
#define RTSC_NAME_ActionType        "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeAction::actionType"
#define RTSC_NAME_PeriodLowerBound  "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeAction::periodLowerBound"
#define RTSC_NAME_PeriodUpperBound  "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeAction::periodUpperBound"
#define RTSC_NAME_ActionWcet        "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeAction::wcet"
#define RTSC_NAME_DoAction          "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLComplexRealtimeState::uMLRealtimeDoAction"
#define RTSC_NAME_EntryAction       "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLComplexRealtimeState::uMLRealtimeEntryAction"
#define RTSC_NAME_ExitAction        "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLComplexRealtimeState::uMLRealtimeExitAction"
#define RTSC_NAME_EventReceive      "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeTransition::uMLRealtimeEvent"
#define RTSC_NAME_EventSend         "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeTransition::uMLRealtimeEvent1"
#define RTSC_NAME_EventTransReceive "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeEvent::uMLRealtimeTransition"
#define RTSC_NAME_EventTransSend    "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeEvent::uMLRealtimeTransition1"
#define RTSC_NAME_EventName         "de.uni_paderborn.fujaba.umlrt.realtimestatechart.UMLRealtimeEvent::name"

#define RTSC_TAG_Object             "object"
#define RTSC_TAG_Class              "class"
#define RTSC_TAG_Attribute          "attribute"
#define RTSC_TAG_Value              "value"
#define RTSC_TAG_Reference          "reference"

#define RTSC_PROPERTY_Name          "name"
#define RTSC_PROPERTY_Id            "id"

#define RTSC_VALUE_True             "true"
#define RTSC_VALUE_Do               "do"
#define RTSC_VALUE_Entry            "entry"
#define RTSC_VALUE_Exit             "exit"

#define EVENT_QUEUE_SIZE            5

#ifndef bool
typedef enum {
	false = 0, 
	true = 1 
} bool;   
#endif

struct Object;
struct Statechart;
struct State;
struct Transition;
struct Action;
struct Event;

typedef struct Object Object;
typedef struct Statechart Statechart;
typedef struct State State;
typedef struct Transition Transition;
typedef struct Action Action;
typedef struct Event Event;

typedef enum {
	START,
	STOP,
	NORMAL
} StateType;

typedef enum {
	DO,
	ENTRY,
	EXIT
} ActionType;

typedef enum {
	SEND,
	RECEIVE
} EventType;

typedef enum {
	STATECHART,
	STATE,
	TRANSITION,
	ACTION,
	EVENT
} ObjectType;

struct Object {
	ObjectType type;
	void *obj;
};

struct Statechart {
	char *id;
	char *name;
	bool is_top_statechart;
	GList *state_list;
	GList *transition_list;
};

struct State {
	char *id;
	char *name;
	char *statechart_id;
	char *do_action_id;
	char *entry_action_id;
	char *exit_action_id;
	StateType type;
	Action *do_action;
	Action *entry_action;
	Action *exit_action;
	Statechart *statechart;
	GList *transition_list;
};

struct Transition {
	char *id;
	char *name;
	char *statechart_id;
	char *from_id;
	char *to_id;
	char *event_send_id;
	char *event_receive_id;
	int priority;
	Statechart *statechart;
	State *from;
	State *to;
	Event *event_send;
	Event *event_receive;
};

struct Action {
	char *id;
	int wcet;
	int lower;
	int upper;
	ActionType type;
};

struct Event {
	char *id;
	char *name;
	char *transition_id;
	Transition *transition;
	int number;
	EventType type;
};

#endif