CppCMS
Public Types | Public Member Functions | List of all members
cppcms::views::generator Class Reference

The class that represents a single skin and generates its views. More...

#include <cppcms/views_pool.h>

Inheritance diagram for cppcms::views::generator:
booster::noncopyable

Public Types

typedef std::auto_ptr< base_viewview_factory_type(std::ostream &, base_content *c)
 The callback that creates a single view.
 

Public Member Functions

template<typename View , typename Content >
void add_view (std::string const &view_name, bool safe=true)
 
void add_factory (std::string const &name, view_factory_type *factory)
 
std::string name () const
 
void name (std::string const &n)
 
std::auto_ptr< base_viewcreate (std::string const &view_name, std::ostream &output, base_content *content) const
 
std::vector< std::string > enumerate () const
 

Detailed Description

The class that represents a single skin and generates its views.

Usually used by templates compiler

Member Function Documentation

void cppcms::views::generator::add_factory ( std::string const &  name,
view_factory_type factory 
)

Add a view that uses a callback

template<typename View , typename Content >
void cppcms::views::generator::add_view ( std::string const &  view_name,
bool  safe = true 
)
inline

Add a single view of type View that uses content of type Content Using name view_name.

If safe is true that dynamic cast is used to ensure that content has proper type otherwise static cast.

Usually used by templates generator

std::auto_ptr<base_view> cppcms::views::generator::create ( std::string const &  view_name,
std::ostream &  output,
base_content content 
) const

Create a view by its name that writes that data to outout using a content content.

std::vector<std::string> cppcms::views::generator::enumerate ( ) const

Enumerate view names

std::string cppcms::views::generator::name ( ) const

Get skin name

void cppcms::views::generator::name ( std::string const &  n)

Set skin name


The documentation for this class was generated from the following file: