Added dummy methods to the ana implementation to achieve compilation.

This commit is contained in:
Guillermo Biset 2010-07-21 21:34:18 +00:00
parent cf60475372
commit e4186a3b11
4 changed files with 38 additions and 29 deletions

View file

@ -72,10 +72,11 @@ whatsoever.
\section{Introduction}
\textbf{Ana} (stands for Asynchronous Network API) is an API designed
to help you develop server and client applications using an
asynchronous model (i.e. non-blocking operations .) By using it the
progammer doesn't need to pay too much attention to the network code
itself but can concentrate on other features relevant to the program.
to help you develop network applications with server and client parts.
To implement this functionality, the API uses an asynchronous model
(i.e. non-blocking operations .) This way, the progammer doesn't need
to pay too much attention to the network code itself but can
concentrate on other features relevant to the program.
Also, \ana \ comes with an accompanying implementation. Hence, it is
also a library that implements the API features. For example, MPI is
@ -225,6 +226,8 @@ The main classes to be used from the \ana \ API are:
connect to a running server. To create a pointer to an object of
this type use the \ana::\texttt{create\_client} function.
\item[ana::timer] : An asynchronous deadline timer that can be used
for general purposes.
\end{description}
\subsection{Main Interfaces}
@ -269,6 +272,16 @@ Here are a few examples of how to construct time durations:
\end{tabular}
\end{center}
There are two ways of creating timers, via an \ana \ component or
using the type directly. You should always try to use ana's server and
client objects to create them via the function
\ana::\texttt{create\_timer}.
The easy way is using the type directly to declare regular variables.
However, this burdens the memory greatly in comparison of using an
\ana \ component (either server or client) to create the timer for
you.
\section{Using the API}
\subsection{Important Recommendations}

View file

@ -234,6 +234,17 @@ namespace network {
}
void add_bandwidth_out(const std::string& /*packet_type*/, size_t /*len*/)
{
//TODO: implement? (apparently called from network_worker only
}
void add_bandwidth_in(const std::string& /*packet_type*/, size_t /*len*/)
{
//TODO: implement? (apparently called from network_worker only
}
std::string get_bandwidth_stats_all()
{
return std::string(""); //TODO: implement

View file

@ -811,18 +811,14 @@ size_t ana_network_manager::number_of_connections() const
return total;
}
/*
std::string ana_network_manager::compress_config( const config& cfg)
std::string ana_network_manager::compress_config( const config& cfg )
{
std::stringstream out;
boost::iostreams::filtering_stream<boost::iostreams::output> filter;
filter.push(boost::iostreams::gzip_compressor());
filter.push(out);
write(filter, cfg);
out.flush();
std::ostringstream out;
compress_config( cfg, out );
return out.str( );
}
*/
void ana_network_manager::compress_config( const config& cfg, std::ostringstream& out)
{
@ -845,11 +841,7 @@ size_t ana_network_manager::send_all( const config& cfg, bool zipped )
{
std::cout << "DEBUG: Sending to everybody. " << (zipped ? "Zipped":"Raw") << "\n";
std::ostringstream out;
compress_config( cfg, out);
const std::string output_string = out.str();
// const std::string output_string = compress_config(cfg);
const std::string output_string = compress_config(cfg);
std::set<ana_component*>::iterator it;
@ -882,11 +874,7 @@ size_t ana_network_manager::send( network::connection connection_num , const con
std::cout << "DEBUG: Single send...\n";
std::ostringstream out;
compress_config( cfg, out);
const std::string output_string = out.str();
// const std::string output_string = compress_config(cfg);
const std::string output_string = compress_config(cfg);
return send_raw_data( output_string.c_str(), output_string.size(), connection_num );
@ -938,11 +926,7 @@ void ana_network_manager::send_all_except(const config& cfg, network::connection
{
std::cout << "DEBUG: send_all_except " << connection_num << "\n";
std::ostringstream out;
compress_config( cfg, out);
const std::string output_string = out.str();
// const std::string output_string = compress_config(cfg);
const std::string output_string = compress_config(cfg);
ana_component_set::iterator it;

View file

@ -485,7 +485,8 @@ class ana_network_manager : public ana::listener_handler,
* @param out : The output stream as output.
*/
void compress_config( const config& cfg, std::ostringstream& out);
// std::string compress_config( const config& cfg);
std::string compress_config( const config& cfg);
/**
* Read a config object from an input buffer.