#ifndef _BLOCK_H_ #define _BLOCK_H_ #include "modelbahn.h" #include "server.h" #define BLOCKF_SHORTTRAIN 0x0001 struct s_Block { char name[REFERENCENAME_LEN]; int flags; } typedef Block; class Blocks { private: Block *blocks; int max; int changed; pthread_mutex_t mtx; int Lock(); int UnLock(); // not thread safe JSONParse _GetJSON(int idx); public: Blocks(); ~Blocks(); bool IsChanged() { return changed; } void ClearChanged() { changed = 0; }; int Change(Block *se); int Delete(string name); JSONParse GetJSON(string name); void GetJSONAll(JSONParse *json); Block GetBlockFromJSON(JSONParse *j); }; #endif