C++ improved declaration of singleton managers

This commit is contained in:
Bruno
2021-04-18 13:27:19 +02:00
parent bb64579fa5
commit d68987be0f
10 changed files with 26 additions and 18 deletions

View File

@@ -12,8 +12,8 @@ class Action
{
// Private Constructor
Action();
Action(Action const& copy); // Not Implemented
Action& operator=(Action const& copy); // Not Implemented
Action(Action const& copy) = delete;
Action& operator=(Action const& copy) = delete;
public:

View File

@@ -62,8 +62,8 @@ class Connection
// Private Constructor
Connection();
Connection(Connection const& copy); // Not Implemented
Connection& operator=(Connection const& copy); // Not Implemented
Connection(Connection const& copy) = delete;
Connection& operator=(Connection const& copy) = delete;
public:
static Connection& manager()

View File

@@ -87,8 +87,8 @@ class Device
friend class DeviceSource;
Device();
Device(Device const& copy); // Not Implemented
Device& operator=(Device const& copy); // Not Implemented
Device(Device const& copy) = delete;
Device& operator=(Device const& copy) = delete;
public:

View File

@@ -84,8 +84,8 @@ class FrameGrabbing
// Private Constructor
FrameGrabbing();
FrameGrabbing(FrameGrabbing const& copy); // Not Implemented
FrameGrabbing& operator=(FrameGrabbing const& copy); // Not Implemented
FrameGrabbing(FrameGrabbing const& copy) = delete;
FrameGrabbing& operator=(FrameGrabbing const& copy) = delete;
public:

View File

@@ -22,6 +22,14 @@ void Interpolator::apply(float percent)
cursor_ = CLAMP( percent, 0.f, 1.f);
if (cursor_ < EPSILON)
current_ = from_;
else if (cursor_ > 1.f - EPSILON)
current_ = to_;
else {
// current_ =
}
subject_->copy(current_);
}

View File

@@ -19,8 +19,8 @@ class Mixer
{
// Private Constructor
Mixer();
Mixer(Mixer const& copy); // Not Implemented
Mixer& operator=(Mixer const& copy); // Not Implemented
Mixer(Mixer const& copy) = delete;
Mixer& operator=(Mixer const& copy) = delete;
public:

View File

@@ -92,8 +92,8 @@ class Rendering
// Private Constructor
Rendering();
Rendering(Rendering const& copy); // Not Implemented
Rendering& operator=(Rendering const& copy); // Not Implemented
Rendering(Rendering const& copy) = delete;
Rendering& operator=(Rendering const& copy) = delete;
public:

View File

@@ -41,6 +41,8 @@ public:
// a Source always has an image processing shader
inline ImageProcessingShader *processingShader () const { return processingshader_; }
void copy(SourceCore const& other);
protected:
// nodes
std::map<View::Mode, Group*> groups_;
@@ -51,8 +53,6 @@ protected:
// pointer to the currently attached shader
// (will be processingshader_ if image processing is enabled)
Shader *renderingshader_;
void copy(SourceCore const& other);
};
class Source : public SourceCore

View File

@@ -29,8 +29,8 @@ class Streaming
// Private Constructor
Streaming();
Streaming(Streaming const& copy); // Not Implemented
Streaming& operator=(Streaming const& copy); // Not Implemented
Streaming(Streaming const& copy) = delete;
Streaming& operator=(Streaming const& copy) = delete;
public:

View File

@@ -125,8 +125,8 @@ class UserInterface
// Private Constructor
UserInterface();
UserInterface(UserInterface const& copy); // Not Implemented
UserInterface& operator=(UserInterface const& copy); // Not Implemented
UserInterface(UserInterface const& copy) = delete;
UserInterface& operator=(UserInterface const& copy) = delete;
public: