File: Effector.cpp

package info (click to toggle)
mercator 0.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,008 kB
  • sloc: sh: 10,433; cpp: 4,482; makefile: 115
file content (51 lines) | stat: -rw-r--r-- 914 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// This file may be redistributed and modified only under the terms of
// the GNU General Public License (See COPYING for details).
// Copyright (C) 2010 Alistair Riddoch

#include <Mercator/Effector.h>

namespace Mercator
{

Effector::Context::Context()
{
}

Effector::Context::~Context()
{
}

void Effector::Context::setId(const std::string& id)
{
    m_id = id;
}

void Effector::setContext(Effector::Context * c)
{
    m_context = c;
}

Effector::Effector() : m_context(0)
{
}

// Ensure that m_context is not copied only one object can own the context
Effector::Effector(const Effector & o) : m_box(o.m_box), m_context(0)
{
}

// Ensure that m_context is not copied only one object can own the context
Effector & Effector::operator=(const Effector & rhs)
{
    m_box = rhs.m_box;
    delete m_context;
    m_context = 0;
    return *this;
}

Effector::~Effector()
{
    delete m_context;
}

} // of namespace