Esempio n. 1
0
void		ModuleNcurses::display(map_t const & map)
{
  uint		x;

  if (werase(this->win) == ERR)
    throw Exception(strerror(errno));
  for (uint y = 0; y != map.size() ; ++y)
    {
      for (x = 0; x != map.size() ; ++x)
	display_slot(x, y, map[y][x]);
    }
  if (wrefresh(this->win) == ERR)
    throw Exception(strerror(errno));
}
Esempio n. 2
0
		static std::uint32_t to(state_t &state, const map_t &map_val)
		{
			::lua_createtable(state, (int)map_val.size(), (int)map_val.size());

			std::for_each(map_val.cbegin(), map_val.cend(), 
				[&state](const typename map_t::value_type &val)
			{
				convertion_t<typename map_t::key_type>::to(state, val.first);
				convertion_t<typename map_t::mapped_type>::to(state, val.second);

				::lua_settable(state, -3);
			});

			return map_val.size() == 0 ? 0 : 1;
		}
 // return the number of operators
 int size() const { return map_index_n.size(); }
Esempio n. 4
0
 // number of elements
 size_t size() {
   return map->size();
 }