They must either support copying or be derived from NonCopyable.
16 files changed:
#include <stdexcept>
#include <string>
#include <stdexcept>
#include <string>
+#include "noncopyable.h"
namespace Msp {
/**
Base class for applications. See also RegisteredApplication.
*/
namespace Msp {
/**
Base class for applications. See also RegisteredApplication.
*/
+class Application: private NonCopyable
{
protected:
class Starter
{
protected:
class Starter
#include <string>
#include <vector>
#include <msp/strings/lexicalcast.h>
#include <string>
#include <vector>
#include <msp/strings/lexicalcast.h>
+#include "noncopyable.h"
arguments and their associated help texts. An application may override this by
providing its own option with the same name.
*/
arguments and their associated help texts. An application may override this by
providing its own option with the same name.
*/
+class GetOpt: private NonCopyable
#define MSP_CORE_MODULE_H_
#include <string>
#define MSP_CORE_MODULE_H_
#include <string>
+#include "noncopyable.h"
+class Module: private NonCopyable
{
private:
struct Private;
{
private:
struct Private;
#ifndef MSP_CORE_MUTEX_H_
#define MSP_CORE_MUTEX_H_
#ifndef MSP_CORE_MUTEX_H_
#define MSP_CORE_MUTEX_H_
+#include "noncopyable.h"
#include "refptr.h"
namespace Msp {
#include "refptr.h"
namespace Msp {
A class for controlling mutually exclusive access to a resource. Only one
thread can hold a lock on the mutex at a time.
*/
A class for controlling mutually exclusive access to a resource. Only one
thread can hold a lock on the mutex at a time.
*/
+class Mutex: private NonCopyable
{
friend class Semaphore;
{
friend class Semaphore;
- Mutex(const Mutex &);
- Mutex &operator=(const Mutex &);
public:
Mutex();
~Mutex();
public:
Mutex();
~Mutex();
#include <vector>
#include <msp/fs/path.h>
#include <msp/io/base.h>
#include <vector>
#include <msp/fs/path.h>
#include <msp/io/base.h>
+#include "noncopyable.h"
the self object take effect immediately. It is recommended to perform such
redirections directly on the Console objects.
*/
the self object take effect immediately. It is recommended to perform such
redirections directly on the Console objects.
*/
+class Process: private NonCopyable
{
public:
typedef std::vector<std::string> Arguments;
{
public:
typedef std::vector<std::string> Arguments;
#define MSP_CORE_SEMAPHORE_H_
#include <msp/time/timedelta.h>
#define MSP_CORE_SEMAPHORE_H_
#include <msp/time/timedelta.h>
+#include "noncopyable.h"
+class Semaphore: private NonCopyable
{
private:
struct Private;
{
private:
struct Private;
#define MSP_CORE_THREAD_H_
#include <string>
#define MSP_CORE_THREAD_H_
#include <string>
+#include "noncopyable.h"
This is to allow initializing variables of the derived class before the thread
is started.
*/
This is to allow initializing variables of the derived class before the thread
is started.
*/
+class Thread: private NonCopyable
{
private:
struct Private;
{
private:
struct Private;
protected:
Thread(const std::string & = std::string());
protected:
Thread(const std::string & = std::string());
-private:
- Thread(const Thread &);
- Thread &operator=(const Thread &);
public:
virtual ~Thread();
public:
virtual ~Thread();
#define MSP_DEBUG_ERRORREPORTER_H_
#include <stdexcept>
#define MSP_DEBUG_ERRORREPORTER_H_
#include <stdexcept>
+#include <msp/core/noncopyable.h>
namespace Msp {
namespace Debug {
namespace Msp {
namespace Debug {
+class ErrorReporter: private NonCopyable
{
private:
ErrorReporter *prev;
{
private:
ErrorReporter *prev;
#include <map>
#include <string>
#include <vector>
#include <map>
#include <string>
#include <vector>
+#include <msp/core/noncopyable.h>
#include <msp/time/timedelta.h>
#include <msp/time/timestamp.h>
#include <msp/time/timedelta.h>
#include <msp/time/timestamp.h>
Note: This is not thread-safe. To profile multiple threads, create a separate
Profiler for each thread.
*/
Note: This is not thread-safe. To profile multiple threads, create a separate
Profiler for each thread.
*/
+class Profiler: private NonCopyable
{
public:
struct CallInfo
{
public:
struct CallInfo
#ifndef MSP_DEBUG_PROFILINGSCOPE_H_
#define MSP_DEBUG_PROFILINGSCOPE_H_
#ifndef MSP_DEBUG_PROFILINGSCOPE_H_
#define MSP_DEBUG_PROFILINGSCOPE_H_
+#include <msp/core/noncopyable.h>
#include <msp/time/timestamp.h>
#include "profiler.h"
#include <msp/time/timestamp.h>
#include "profiler.h"
created and ends when it goes out of scope. If there was another object in an
outer scope, it is notified of the time used in inner scopes.
*/
created and ends when it goes out of scope. If there was another object in an
outer scope, it is notified of the time used in inner scopes.
*/
+class ProfilingScope: private NonCopyable
{
private:
Profiler &profiler;
{
private:
Profiler &profiler;
#include <sigc++/sigc++.h>
#include <msp/core/mutex.h>
#include <sigc++/sigc++.h>
#include <msp/core/mutex.h>
+#include <msp/core/noncopyable.h>
#include "handle.h"
#include "mode.h"
#include "poll.h"
#include "handle.h"
#include "mode.h"
#include "poll.h"
/**
Common interface for all I/O objects.
*/
/**
Common interface for all I/O objects.
*/
+class Base: private NonCopyable
{
public:
/** RAII synchronization primitive. Prevents concurrent access to the
{
public:
/** RAII synchronization primitive. Prevents concurrent access to the
-private:
- Base(const Base &);
- Base &operator=(const Base &);
#ifndef MSP_IO_EVENTREADER_H_
#define MSP_IO_EVENTREADER_H_
#ifndef MSP_IO_EVENTREADER_H_
#define MSP_IO_EVENTREADER_H_
+#include <msp/core/noncopyable.h>
#include "handle.h"
namespace Msp {
#include "handle.h"
namespace Msp {
Unix-based systems can poll the fd directly, so this class reduces to a simple
passthrough to sys_read.
*/
Unix-based systems can poll the fd directly, so this class reduces to a simple
passthrough to sys_read.
*/
+class EventReader: private NonCopyable
{
private:
struct Private;
{
private:
struct Private;
#include <list>
#include <map>
#include <vector>
#include <list>
#include <map>
#include <vector>
+#include <msp/core/noncopyable.h>
#include <msp/time/timedelta.h>
namespace Msp {
#include <msp/time/timedelta.h>
namespace Msp {
{ return PollEvent(~static_cast<int>(e)); }
{ return PollEvent(~static_cast<int>(e)); }
+class Poller: private NonCopyable
+Formatter::Formatter(const Formatter &other):
+ fmt(other.fmt),
+ pos(fmt.begin()+(other.pos-other.fmt.begin())),
+ result(other.result)
+{ }
+
+Formatter &Formatter::operator=(const Formatter &other)
+{
+ fmt = other.fmt;
+ pos = fmt.begin()+(other.pos-other.fmt.begin());
+ result = other.result;
+ return *this;
+}
+
const string &Formatter::str() const
{
if(pos!=fmt.end())
const string &Formatter::str() const
{
if(pos!=fmt.end())
public:
Formatter(const std::string &);
public:
Formatter(const std::string &);
+ Formatter(const Formatter &);
+ Formatter &operator=(const Formatter &);
/** Extracts the next conversion from the format string and formats the
given value with it. Will throw if no more conversions are found. */
/** Extracts the next conversion from the format string and formats the
given value with it. Will throw if no more conversions are found. */
#include <vector>
#include <sigc++/sigc++.h>
#include <msp/core/mutex.h>
#include <vector>
#include <sigc++/sigc++.h>
#include <msp/core/mutex.h>
+#include <msp/core/noncopyable.h>
#include <msp/core/semaphore.h>
#include "timedelta.h"
#include "timestamp.h"
#include <msp/core/semaphore.h>
#include "timedelta.h"
#include "timestamp.h"
This class is thread-safe, to allow running timers in a separate thread.
*/
This class is thread-safe, to allow running timers in a separate thread.
*/
+class Timer: private NonCopyable