这是内存映射文件共享的示例代码。 mapped_region是负责它的d类 现在我深入挖掘之前,我不能跟踪为什么使用这种声明。任何人都可以向我解释这个吗?是否有可能有一个构造函数的参数作为类名C++?
class mapped_region
{
// Non-copyable
mapped_region(const mapped_region &);
// Non-assignable
mapped_region &operator=(const mapped_region &);
public:
typedef /*implementation-defined*/ offset_t;
typedef /*implementation-defined*/ accessmode_t;
static const accessmode_t invalid_mode;
static const accessmode_t read_only;
static const accessmode_t read_write;
static const accessmode_t copy_on_write;
mapped_region();
mapped_region(const memory_mappable & mappable
, accessmode_t mode
, offset_t mappable_offset
, std::size_t size = 0
, const void * address = 0);
mapped_region(mapped_region &&other);
std::size_t get_size() const;
void* get_address() const;
offset_t get_offset() const;
accessmode_t get_mode() const;
void flush(std::size_t region_offset = 0, std::size_t numbytes = 0);
void swap(mapped_region &other);
~mapped_region();
};
在这个例子中
// Non-copyable
mapped_region(const mapped_region &);
是什么意思呢?
非常感谢你,我现在可以更好地理解:) – Nisha 2012-02-15 11:41:09
@judithnisha:没问题。很高兴能帮助你更好地理解:) – 2012-02-15 11:42:21