C
Christopher Pisz
I got handed a project that uses ref counting from Scott Meyers "More
Effective C++." It's old. I can't use the latest standard or boost,
currently.
I wonder if there is anyone around that is intimate with those chapters
of his book. There is some confusion about where the real data goes and
if it is or is not a pointer.
The example of String and StringValue is confusing, because char * is
the data. So when trying to use the example, one wonders if the
mentality is StringValue is the data with ref counting as part of the
class or if the char * it contains is the data.
Lets say I had a class Animal for example.
Do I make:
Animal - with its data and methods
AnimalRCO : public RefCountedObject - containing a pointer to an animal
AnimalRCP - Containing the template RCO instance as a member
or
AnimalRCO : public RefCountedObject - containing all the data an Animal
would
AnimalRCP - having all the methods an Animal would
I am thinking the latter, but some colleagues are thinking the former.
or perhaps even
AnimalRCO : public RefCountedObject - containing all the data _and_
methods an Animal would
AnimalRCP - having methods that call methods on the RCO for the Animal
interface
-------------------
Also, the book doesn't seem to cover assignment operator as thoroughly
as I would like
What if an Animal or AnimalRCO has a constructor that takes an int
(perhaps for number of legs)
When I say AnimalRFP = 0; what am I really saying?
Effective C++." It's old. I can't use the latest standard or boost,
currently.
I wonder if there is anyone around that is intimate with those chapters
of his book. There is some confusion about where the real data goes and
if it is or is not a pointer.
The example of String and StringValue is confusing, because char * is
the data. So when trying to use the example, one wonders if the
mentality is StringValue is the data with ref counting as part of the
class or if the char * it contains is the data.
Lets say I had a class Animal for example.
Do I make:
Animal - with its data and methods
AnimalRCO : public RefCountedObject - containing a pointer to an animal
AnimalRCP - Containing the template RCO instance as a member
or
AnimalRCO : public RefCountedObject - containing all the data an Animal
would
AnimalRCP - having all the methods an Animal would
I am thinking the latter, but some colleagues are thinking the former.
or perhaps even
AnimalRCO : public RefCountedObject - containing all the data _and_
methods an Animal would
AnimalRCP - having methods that call methods on the RCO for the Animal
interface
-------------------
Also, the book doesn't seem to cover assignment operator as thoroughly
as I would like
What if an Animal or AnimalRCO has a constructor that takes an int
(perhaps for number of legs)
When I say AnimalRFP = 0; what am I really saying?