Menu

[r164]: / templates / trunk / content.cpp  Maximize  Restore  History

Download this file

28 lines (20 with data), 511 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "content.h"
namespace tmpl {
content::vector_t &content::vector(std::string const key,int reserve)
{
vector_t &v=boost::any_cast<vector_t & >
((*this)[key] = vector_t());
v.reserve(reserve);
return v;
}
content::list_t &content::list(std::string const key)
{
return boost::any_cast<list_t & >((*this)[key] = list_t());
}
void content::signal(std::string const &key,callback_t::slot_type slot)
{
callback_ptr cb(new callback_t);
cb->connect(slot);
(*this)[key]=cb;
}
} // namespace tmpl
MongoDB Logo MongoDB