Browse Source

Replaced noncopyable with booster::noncopyable

master
Artyom Beilis 14 years ago
parent
commit
08a10832f3
38 changed files with 69 additions and 103 deletions
  1. +2
    -2
      application.h
  2. +1
    -1
      applications_pool.cpp
  3. +2
    -2
      applications_pool.h
  4. +2
    -2
      base_view.h
  5. +2
    -2
      cache_interface.h
  6. +1
    -1
      cache_pool.h
  7. +1
    -1
      cgi_api.cpp
  8. +2
    -2
      cgi_api.h
  9. +3
    -3
      form.h
  10. +2
    -2
      http_client.h
  11. +2
    -2
      http_connection.h
  12. +1
    -1
      http_file.h
  13. +2
    -2
      http_request.h
  14. +2
    -2
      http_response.h
  15. +1
    -1
      logger.cpp
  16. +2
    -2
      logger.h
  17. +0
    -34
      noncopyable.h
  18. +6
    -6
      posix_util.h
  19. +3
    -3
      regex.h
  20. +2
    -2
      service.h
  21. +1
    -1
      service_impl.h
  22. +2
    -2
      session_api.h
  23. +2
    -2
      session_cookies.h
  24. +2
    -2
      session_interface.h
  25. +1
    -1
      session_pool.h
  26. +1
    -1
      session_sid.cpp
  27. +2
    -2
      session_storage.h
  28. +1
    -1
      shmem_allocator.h
  29. +2
    -2
      tcp_cache_server.h
  30. +2
    -2
      tcp_connector.h
  31. +2
    -2
      tcp_messenger.h
  32. +1
    -1
      thread_pool.cpp
  33. +2
    -2
      thread_pool.h
  34. +2
    -2
      urandom.h
  35. +1
    -1
      url_dispatcher.cpp
  36. +2
    -2
      url_dispatcher.h
  37. +2
    -2
      views_pool.cpp
  38. +2
    -2
      views_pool.h

+ 2
- 2
application.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_APPLICATION_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include "atomic_counter.h"
#include <booster/hold_ptr.h>
#include "intrusive_ptr.h"
@@ -86,7 +86,7 @@ namespace cppcms {
/// parent class and it destroys an attached class with delete.
///

class CPPCMS_API application : public util::noncopyable {
class CPPCMS_API application : public booster::noncopyable {
public:
///
/// Create a new application running on service \a srv, with a parent \a parent


+ 1
- 1
applications_pool.cpp View File

@@ -38,7 +38,7 @@

namespace cppcms {

struct applications_pool::basic_app_data : public util::noncopyable {
struct applications_pool::basic_app_data : public booster::noncopyable {
basic_app_data(std::string script) :
script_name(script),
match(0),


+ 2
- 2
applications_pool.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_APPLICATIONS_POOL_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include <booster/hold_ptr.h>
#include "intrusive_ptr.h"

@@ -54,7 +54,7 @@ namespace cppcms {
///
/// \brief a base class for user application factories
///
struct factory : public util::noncopyable {
struct factory : public booster::noncopyable {
///
/// Returns newly created instance of an application.
///


+ 2
- 2
base_view.h View File

@@ -30,7 +30,7 @@

#include <booster/hold_ptr.h>
#include "base_content.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include "config.h"

namespace cppcms {
@@ -43,7 +43,7 @@ namespace cppcms {
/// class.
///

class CPPCMS_API base_view : util::noncopyable {
class CPPCMS_API base_view : booster::noncopyable {
public:
///
/// The main rendering function -- render the main HTML page. It is usually overridden in template engine.


+ 2
- 2
cache_interface.h View File

@@ -23,7 +23,7 @@
#include <set>

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include "intrusive_ptr.h"
#include <booster/hold_ptr.h>
#include "cstdint.h"
@@ -82,7 +82,7 @@ namespace cppcms {

class CPPCMS_API cache_interface : public util::noncopyable {
class CPPCMS_API cache_interface : public booster::noncopyable {
public:

///


+ 1
- 1
cache_pool.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_CACHE_POOL_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include "intrusive_ptr.h"
#include <booster/hold_ptr.h>



+ 1
- 1
cgi_api.cpp View File

@@ -127,7 +127,7 @@ private:
};


class multipart_parser : public util::noncopyable {
class multipart_parser : public booster::noncopyable {
public:
multipart_parser(std::vector<char> &body, unsigned &ptr) :
separator_(body,ptr),


+ 2
- 2
cgi_api.h View File

@@ -19,7 +19,7 @@
#ifndef CPPCMS_IMPL_CGI_API_H
#define CPPCMS_IMPL_CGI_API_H

#include "noncopyable.h"
#include <booster/noncopyable.h>
#include "refcounted.h"
#include "intrusive_ptr.h"
#include <vector>
@@ -48,7 +48,7 @@ namespace cgi {
typedef booster::function<void()> callback;
typedef booster::function<void(bool)> ehandler;

class acceptor : public util::noncopyable {
class acceptor : public booster::noncopyable {
public:
virtual void async_accept() = 0;
virtual void stop() = 0;


+ 3
- 3
form.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_FORM_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>

#include <string>
#include <set>
@@ -160,7 +160,7 @@ namespace cppcms {
/// and validation of forms that include more then one widget
///

class CPPCMS_API form : public util::noncopyable,
class CPPCMS_API form : public booster::noncopyable,
public base_form
{
public:
@@ -371,7 +371,7 @@ namespace cppcms {

class CPPCMS_API base_widget :
public base_form,
public util::noncopyable
public booster::noncopyable
{
public:



+ 2
- 2
http_client.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_HTTP_CLIENT_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>

namespace cppcms {
class service;
@@ -29,7 +29,7 @@ namespace cppcms {
///
/// Very simple HTTP client for performing HTTP requests from CppCMS applications
///
class CPPCMS_API http_client : public util::noncopyable {
class CPPCMS_API http_client : public booster::noncopyable {
public:
///
/// Create new HTTP client


+ 2
- 2
http_connection.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_HTTP_CONNECTION_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>

namespace cppcms {

@@ -28,7 +28,7 @@ namespace cppcms {
class request;
class response;

class CGICC_API connection : private util::noncopyable {
class CGICC_API connection : private booster::noncopyable {
public:
http::request &request() = 0;
http::response &response() = 0;


+ 1
- 1
http_file.h View File

@@ -21,7 +21,7 @@

#include "defs.h"
#include <booster/hold_ptr.h>
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include <sstream>
#include <fstream>



+ 2
- 2
http_request.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_HTTP_REQUEST_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include <booster/hold_ptr.h>

#include <string>
@@ -35,7 +35,7 @@ namespace http {
class cookie;
class file;

class CPPCMS_API request : public util::noncopyable {
class CPPCMS_API request : public booster::noncopyable {
public:

// RFC 3875


+ 2
- 2
http_response.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_HTTP_RESPONSE_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include <booster/hold_ptr.h>

#include <string>
@@ -35,7 +35,7 @@ namespace http {
class context;
class cookie;

class CPPCMS_API response : public util::noncopyable {
class CPPCMS_API response : public booster::noncopyable {
public:
// RFC 2616 sec. 6.1.1
typedef enum {


+ 1
- 1
logger.cpp View File

@@ -37,7 +37,7 @@

namespace cppcms {
namespace impl {
class log_device : public util::noncopyable {
class log_device : public booster::noncopyable {
public:
virtual void write(std::string const &msg) = 0;
virtual ~log_device() {}


+ 2
- 2
logger.h View File

@@ -25,10 +25,10 @@

#include <booster/copy_ptr.h>
#include <booster/hold_ptr.h>
#include "noncopyable.h"
#include <booster/noncopyable.h>

namespace cppcms {
class CPPCMS_API logger : public util::noncopyable {
class CPPCMS_API logger : public booster::noncopyable {
public:
typedef enum {
fatal = 10,


+ 0
- 34
noncopyable.h View File

@@ -1,34 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2008-2010 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef CPPCMS_UTIL_NONCOPYABLE_H
#define CPPCMS_UTIL_NONCOPYABLE_H

namespace cppcms {
namespace util {
class noncopyable {
private:
noncopyable(noncopyable const &);
noncopyable const &operator=(noncopyable const &);
protected:
noncopyable(){}
~noncopyable(){}
};
}} // cppcms::util

#endif

+ 6
- 6
posix_util.h View File

@@ -28,7 +28,7 @@
#include <string.h>
#include <pthread.h>
#include "cppcms_error.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>

namespace cppcms {
namespace impl {
@@ -137,7 +137,7 @@ namespace impl {
}


class mutex : public util::noncopyable {
class mutex : public booster::noncopyable {
public:
class guard;
mutex(bool pshared = false) :
@@ -202,7 +202,7 @@ namespace impl {
pthread_mutex_t normal_;
};

class mutex::guard : public util::noncopyable {
class mutex::guard : public booster::noncopyable {
public:
guard(mutex &m) : m_(m)
{
@@ -216,7 +216,7 @@ namespace impl {
mutex &m_;
};
class shared_mutex : public util::noncopyable {
class shared_mutex : public booster::noncopyable {
public:
class shared_guard;
class unique_guard;
@@ -295,7 +295,7 @@ namespace impl {
pthread_rwlock_t normal_;
};
class shared_mutex::shared_guard : public util::noncopyable {
class shared_mutex::shared_guard : public booster::noncopyable {
public:
shared_guard(shared_mutex &m) : m_(m)
{
@@ -309,7 +309,7 @@ namespace impl {
shared_mutex &m_;
};
class shared_mutex::unique_guard : public util::noncopyable {
class shared_mutex::unique_guard : public booster::noncopyable {
public:
unique_guard(shared_mutex &m) : m_(m)
{


+ 3
- 3
regex.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_UTIL_REGEX_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include <booster/hold_ptr.h>
#include <string>

@@ -39,7 +39,7 @@ namespace cppcms { namespace util {
///
class CPPCMS_API regex : public noncopyable {
class CPPCMS_API regex : public booster::noncopyable {
public:
///
/// Creates new object that is used to match a regular \a expression.
@@ -74,7 +74,7 @@ namespace cppcms { namespace util {
/// \a util::regex.
///

class CPPCMS_API regex_result : public noncopyable {
class CPPCMS_API regex_result : public booster::noncopyable {
public:
regex_result();
~regex_result();


+ 2
- 2
service.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_SERVICE_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include <booster/hold_ptr.h>
#include <booster/function.h>
#include <locale>
@@ -48,7 +48,7 @@ namespace cppcms {
class value;
}

class CPPCMS_API service : public util::noncopyable
class CPPCMS_API service : public booster::noncopyable
{
public:
service(json::value const &v);


+ 1
- 1
service_impl.h View File

@@ -44,7 +44,7 @@ namespace impl {
class acceptor;
}

class service : public util::noncopyable {
class service : public booster::noncopyable {
public:
service();
~service();


+ 2
- 2
session_api.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_SESSION_API_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include "refcounted.h"
#include "intrusive_ptr.h"
#include <string>
@@ -30,7 +30,7 @@ namespace cppcms {
class session_interface;

class session_api :
public util::noncopyable,
public booster::noncopyable,
public refcounted
{
public:


+ 2
- 2
session_cookies.h View File

@@ -20,14 +20,14 @@
#define CPPCMS_SESSION_COOKIES_H
#include "session_api.h"
#include <booster/hold_ptr.h>
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include <memory>
#include <string>
namespace cppcms {
class session_interface;
namespace sessions {

class encryptor : public util::noncopyable {
class encryptor : public booster::noncopyable {
public:
virtual std::string encrypt(std::string const &plain,time_t timeout) = 0;
virtual bool decrypt(std::string const &cipher,std::string &plain,time_t *timeout = 0) = 0;


+ 2
- 2
session_interface.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_SESSION_INTERFACE_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include <booster/hold_ptr.h>
#include "intrusive_ptr.h"
#include "cstdint.h"
@@ -39,7 +39,7 @@ namespace http {

class session_api;

class CPPCMS_API session_interface : private util::noncopyable {
class CPPCMS_API session_interface : private booster::noncopyable {
public:

session_interface(http::context &);


+ 1
- 1
session_pool.h View File

@@ -34,7 +34,7 @@ namespace cppcms {
class session_storage_factory;
};
class CPPCMS_API session_pool: public util::noncopyable {
class CPPCMS_API session_pool: public booster::noncopyable {
public:
session_pool(service &srv);
~session_pool();


+ 1
- 1
session_sid.cpp View File

@@ -43,7 +43,7 @@ namespace sessions {
namespace impl {
using namespace cppcms::impl;

class sid_generator : public util::noncopyable {
class sid_generator : public booster::noncopyable {
public:
sid_generator()
{


+ 2
- 2
session_storage.h View File

@@ -21,7 +21,7 @@

#include "defs.h"
#include "refcounted.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include "intrusive_ptr.h"
#include <string>

@@ -38,7 +38,7 @@ namespace sessions {
///
class session_storage :
public util::noncopyable,
public booster::noncopyable,
public refcounted
{
public:


+ 1
- 1
shmem_allocator.h View File

@@ -34,7 +34,7 @@
namespace cppcms {
namespace impl {

class shmem_control : public util::noncopyable{
class shmem_control : public booster::noncopyable{
public:
shmem_control(size_t size) :
size_(size),


+ 2
- 2
tcp_cache_server.h View File

@@ -21,14 +21,14 @@

#include "defs.h"
#include "base_cache.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include "intrusive_ptr.h"
#include <booster/hold_ptr.h>

namespace cppcms {
namespace impl {

class CPPCMS_API tcp_cache_service : public util::noncopyable {
class CPPCMS_API tcp_cache_service : public booster::noncopyable {
public:
tcp_cache_service(intrusive_ptr<base_cache> cache,int threads,std::string ip,int port);
~tcp_cache_service();


+ 2
- 2
tcp_connector.h View File

@@ -21,7 +21,7 @@

#include <string>
#include <vector>
#include "noncopyable.h"
#include <booster/noncopyable.h>

namespace cppcms {

@@ -29,7 +29,7 @@ namespace impl {
class messenger;
struct tcp_operation_header;

class tcp_connector : private util::noncopyable
class tcp_connector : private booster::noncopyable
{
protected:
messenger *tcp;


+ 2
- 2
tcp_messenger.h View File

@@ -19,12 +19,12 @@
#ifndef CPPCMS_TCP_MESSENGER_H
#define CPPCMS_TCP_MESSENGER_H
#include <booster/aio/socket.h>
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include "tcp_cache_protocol.h"

namespace cppcms {
namespace impl {
class messenger : public util::noncopyable {
class messenger : public booster::noncopyable {
booster::aio::socket socket_;
std::string ip_;
int port_;


+ 1
- 1
thread_pool.cpp View File

@@ -38,7 +38,7 @@

namespace cppcms {
namespace impl {
class thread_pool : public util::noncopyable {
class thread_pool : public booster::noncopyable {
public:

bool cancel(int id) {


+ 2
- 2
thread_pool.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_THREAD_POOL_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include <booster/function.h>
#include <booster/hold_ptr.h>

@@ -30,7 +30,7 @@ namespace cppcms {
class thread_pool;
}

class CPPCMS_API thread_pool : public util::noncopyable {
class CPPCMS_API thread_pool : public booster::noncopyable {
public:

int post(booster::function<void()> const &job);


+ 2
- 2
urandom.h View File

@@ -21,10 +21,10 @@

#include "defs.h"
#include <booster/hold_ptr.h>
#include "noncopyable.h"
#include <booster/noncopyable.h>

namespace cppcms {
class CPPCMS_API urandom_device : public util::noncopyable {
class CPPCMS_API urandom_device : public booster::noncopyable {
public:
urandom_device();
~urandom_device();


+ 1
- 1
url_dispatcher.cpp View File

@@ -32,7 +32,7 @@
namespace cppcms {

namespace /* anon */ {
struct option : public util::noncopyable {
struct option : public booster::noncopyable {
option(std::string expr) :
expr_(expr)
{


+ 2
- 2
url_dispatcher.h View File

@@ -19,7 +19,7 @@
#ifndef CPPCMS_URL_DISPATCHER_H
#define CPPCMS_URL_DISPATCHER_H

#include "noncopyable.h"
#include <booster/noncopyable.h>
#include "defs.h"
#include <booster/function.h>
#include <booster/hold_ptr.h>
@@ -51,7 +51,7 @@ namespace cppcms {
/// \endcode
///

class CPPCMS_API url_dispatcher : public util::noncopyable {
class CPPCMS_API url_dispatcher : public booster::noncopyable {
public:
// Handlers
typedef booster::function<void()> handler;


+ 2
- 2
views_pool.cpp View File

@@ -45,7 +45,7 @@
namespace cppcms {
namespace impl {
#ifdef CPPCMS_WIN32
class shared_object : public util::noncopyable {
class shared_object : public booster::noncopyable {
public:
static std::string name(std::string file,std::string path);

@@ -93,7 +93,7 @@ namespace impl {
bool remove_;
};
#else
class shared_object : public util::noncopyable {
class shared_object : public booster::noncopyable {
public:
static std::string name(std::string file,std::string path);



+ 2
- 2
views_pool.h View File

@@ -20,7 +20,7 @@
#define CPPCMS_VIEWS_POOL_H

#include "defs.h"
#include "noncopyable.h"
#include <booster/noncopyable.h>
#include "base_view.h"

#include <memory>
@@ -31,7 +31,7 @@ namespace cppcms {

namespace json { class value; }

class CPPCMS_API views_pool : public util::noncopyable {
class CPPCMS_API views_pool : public booster::noncopyable {
public:
typedef std::auto_ptr<base_view> (*view_factory_type)(std::ostream &,base_content *c);
typedef std::map<std::string,view_factory_type> mapping_type;


Loading…
Cancel
Save