2
// C++ Interface: required
7
// Author: Erik Hjortsberg <erik.hjortsberg@gmail.com>, (C) 2007
9
// This program is free software; you can redistribute it and/or modify
10
// it under the terms of the GNU General Public License as published by
11
// the Free Software Foundation; either version 2 of the License, or
12
// (at your option) any later version.
14
// This program is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
// GNU General Public License for more details.
19
// You should have received a copy of the GNU General Public License
20
// along with this program; if not, write to the Free Software
21
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.//
23
#define __operator_dereference operator*
24
#define __operator_index operator[]
26
#include <Atlas/Message/Element.h>
30
Utility method for the lua bindings which looks for a entry in a const map. If no entry is found we'll return null, which will be translated to "nil" in lua.
32
const Atlas::Message::Element& _MapType_findInMap(const Atlas::Message::MapType* map, const std::string& key) {
33
Atlas::Message::MapType::const_iterator I = map->find(key);
34
if (I != map->end()) {
37
///we'll avoid compiler warnings by doing it this way
38
static Atlas::Message::Element* element(0);
44
* Method that checks, is Lua variable has number type exactly, not a string
46
TOLUA_API int tolua_isnumber_type (lua_State* L, int lo, int def, tolua_Error* err)
48
if (def && lua_gettop(L)<abs(lo))
50
if (lua_type(L,lo) == LUA_TNUMBER)
59
* Method that checks, is Lua variable has string type exactly, not a number
61
TOLUA_API int tolua_isstring_type (lua_State* L, int lo, int def, tolua_Error* err)
63
if (def && lua_gettop(L)<abs(lo))
65
if (lua_type(L,lo) == LUA_TSTRING)
73
#define tolua_iscppstring_type tolua_isstring_type