antTypes.cc

Go to the documentation of this file.
00001 /*
00002  * This file is part of openSDK.
00003  *
00004  * Copyright (C) 2006-2007 openSDK team
00005  *
00006  * openSDK is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; version 2.
00009  *
00010  * openSDK is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with openSDK; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  *
00019  *     $Id: antTypes.cc,v 1.3 2007/01/26 23:12:05 nuno-lopes Exp $
00020  */
00021 
00022 #include <antTypes.h>
00023 
00024 static const char* antErrorStrings[] = {
00025         "ANT_SUCCESS",
00026         "ANT_FAIL",
00027         "ANT_NOMEMORY",
00028         "ANT_INVALIDPTR",
00029         "ANT_NO_STATE_TRANSITION",
00030         "ANT_SDU_BADRANGE",
00031         "ANT_SDU_NOMORE_DATACELL",
00032         "ANT_SDU_NOOWNER",
00033         "ANT_SDUPOOL_ALLOCATED",
00034         "ANT_SDUPOOL_NOTASSIGNED",
00035         "ANT_QUEUE_EMPTY",
00036         "ANT_QUEUE_STATE",
00037         "ANT_QUEUE_CLOSED",
00038         "ANT_QUEUE_REJECTED",
00039         "ANT_QUEUE_BLOCKED",
00040         "ANT_INVALIDMODULEID",
00041         "ANT_TMR_TYPE_INVALID",
00042         "ANT_TMR_MAXNMBR_REACHED",
00043         "ANT_NOMESSAGES",
00044         "ANT_NAMING_ENTRY_EXISTS",
00045         "ANT_NAMING_NO_SUCH_NAME",
00046         "ANT_NAMING_NAME_INVALID",
00047         "ANT_REGISTRY_DUPLICATE_KEY",
00048         "ANT_REGISTRY_NO_KEY",
00049         "ANT_REGISTRY_WRONG_TYPE",
00050         "ANT_REGISTRY_INVALID_KEY",
00051         "ANT_REGISTRY_INVALID_VALUE",
00052         "ANT_ENDPOINT_NOFACTORY",
00053         "ANT_NOT_INITIALIZED",
00054         "ANT_INITIALIZING"
00055 };
00056 
00057 const char* antErrorString(antError error)
00058 {
00059         if ((unsigned)error >= sizeof(antErrorStrings)/sizeof(*antErrorStrings) || error < 0) {
00060                 return "UNKNOWN ANT ERROR";
00061         }
00062         return antErrorStrings[error];
00063 }
00064 
00065 OSTREAM& operator<<(OSTREAM& os, antError error)
00066 {
00067         os << antErrorString(error);
00068         return os;
00069 }

Generated on Sun Dec 2 23:04:27 2007 for openSDK by  doxygen 1.3.9.1