static bool handleCreateTask(int size, const byte *msg, CONTEXT *context) { byte *expr = (byte *) &msg[1]; byte id = evalWord8Expr(&expr, context); unsigned int taskSize = evalWord16Expr(&expr, context); unsigned int bindSize = evalWord16Expr(&expr, context); return createById(id, taskSize, bindSize); }
StdMessage::UniquePtr_t StdMessageFactory::Create( char* p_message, int p_length ) { #ifdef _DEBUG /*sLogger.Debug(QString("StdMessageFactory::Create: creating standard message with id `%1`..."). arg(QString::fromAscii(p_message, 2)));*/ #endif auto id = StdMessage::MapIdStrToEnum(p_message); auto msg = createById(id, p_message, p_length); if (!msg->IsCorrect()) { msg = StdMessage::UniquePtr_t(new RawStdMessage(p_message, p_length)); } return msg; }