shared-space-data.hpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2017
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
namespace Gecode { namespace Kernel {
class SharedSpaceData : public SharedHandle {
public:
class Data : public SharedHandle::Object {
public:
SharedMemory sm;
GPI gpi;
Data(void);
virtual ~Data(void);
};
SharedSpaceData(void);
SharedSpaceData(const SharedSpaceData& ssd);
SharedSpaceData& operator =(const SharedSpaceData& r);
~SharedSpaceData(void);
Data& data(void) const;
};
forceinline
SharedSpaceData::Data::Data(void) {}
forceinline
SharedSpaceData::Data::~Data(void) {}
forceinline
SharedSpaceData::SharedSpaceData(void)
: SharedHandle(new Data) {}
forceinline
SharedSpaceData::SharedSpaceData(const SharedSpaceData& ssd)
: SharedHandle(ssd) {}
forceinline SharedSpaceData&
SharedSpaceData::operator =(const SharedSpaceData& ssd) {
(void) SharedHandle::operator =(ssd);
return *this;
}
forceinline
SharedSpaceData::~SharedSpaceData(void) {}
forceinline SharedSpaceData::Data&
SharedSpaceData::data(void) const {
return static_cast<Data&>(*object());
}
}}
// STATISTICS: kernel-memory
Gecode::Kernel::GPI
Global propagator information.
Definition gpi.hpp:39
Gecode::Kernel::SharedMemory
Shared object for several memory areas.
Definition manager.hpp:60
Gecode::Kernel::SharedSpaceData::Data
The shared data.
Definition shared-space-data.hpp:40
Gecode::Kernel::SharedSpaceData::Data::Data
Data(void)
Default constructor.
Definition shared-space-data.hpp:66
Gecode::Kernel::SharedSpaceData::Data::gpi
GPI gpi
The global propagator information.
Definition shared-space-data.hpp:45
Gecode::Kernel::SharedSpaceData::Data::sm
SharedMemory sm
The shared memory area.
Definition shared-space-data.hpp:43
Gecode::Kernel::SharedSpaceData::Data::~Data
virtual ~Data(void)
Destructor.
Definition shared-space-data.hpp:69
Gecode::Kernel::SharedSpaceData
Class to store data shared among several spaces.
Definition shared-space-data.hpp:37
Gecode::Kernel::SharedSpaceData::operator=
SharedSpaceData & operator=(const SharedSpaceData &r)
Assignment operator.
Definition shared-space-data.hpp:82
Gecode::Kernel::SharedSpaceData::~SharedSpaceData
~SharedSpaceData(void)
Delete.
Definition shared-space-data.hpp:88
Gecode::Kernel::SharedSpaceData::SharedSpaceData
SharedSpaceData(void)
Initialize.
Definition shared-space-data.hpp:74
Gecode::Kernel::SharedSpaceData::data
Data & data(void) const
Provide access.
Definition shared-space-data.hpp:91
Gecode::SharedHandle::Object
The shared object.
Definition shared-object.hpp:53
Gecode::SharedHandle::SharedHandle
SharedHandle(void)
Create shared handle with no object pointing to.
Definition shared-object.hpp:122
Gecode::SharedHandle::object
SharedHandle::Object * object(void) const
Access to the shared object.
Definition shared-object.hpp:102
Gecode::Kernel
Kernel functionality
Gecode
Gecode toplevel namespace
forceinline
#define forceinline
Definition config.hpp:187