Copy/assignment of sc_object

From: Philipp A. Hartmann <philipp.hartmann@offis.de>
Date: Tue Oct 26 2010 - 06:50:02 PDT

John,

since users can derive their own classes from sc_object, but such
objects still have an explicit identity within the object hierarchy,
sc_object's copy constructor/copy-assignment operator should probably be
disabled, right?

Is this an oversight in 1666-2005? I think, in sc_object's class
definition (6.15.3), we should add

private:
  // disabled
  sc_object( const sc_object& );
  sc_object& operator=( const sc_object& );

The attached test program compiles fine and crashes (after pressing
<enter>) with OSCI's PoC implementation.

NB: sc_module is missing explicitly disabled copy/assignment as well.
    But these are correctly disabled in the OSCI simulator.

I think, if we would want to support copying and assigning user-defined
sc_objects, we would need to define the semantics wrt. the object
hierarchy explicitly.

What do you think?

Greetings from Oldenburg,
  Philipp

-- 
Philipp A. Hartmann
Hardware/Software Design Methodology Group
OFFIS Institute for Information Technology
R&D Division Transportation · FuE-Bereich Verkehr
Escherweg 2 · 26121 Oldenburg · Germany
Phone/Fax: +49-441-9722-420/282 · PGP: 0x9161A5C0 · http://www.offis.de/
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Received on Tue Oct 26 06:50:32 2010

This archive was generated by hypermail 2.1.8 : Tue Oct 26 2010 - 06:50:36 PDT