C++ Derived Classes
Posted on 2009-05-08
I am currently building many containers to hold various types of information that is being extracted from logs. I have vectors and multisets to store the objects of certain classes that are being created from the parsing of the logs. For example, I have an ACTOR class that has attributes of name and address. However, I also want a CONVERSATION class to be an object of each ACTOR class, which i want to store in containers as they are created.
So I effectively want an object of an object - both of which will be stored in a container.
I am doing this because i want to be able to count the number of conversations per actor depending on certain attributes of the conversation object.
so for example i would create the new actor object within a mulitset using something like
actor_set.insert(actor(name, address, age)).
When i continue to parse the file and a conversation corresponding to the actor.name is discovered, I want to insert a conversation object within the actor object and keep adding to it as more conversations are found.
If anyone understands what I am trying to do - but could offer a better alternative - I would appreciate the advice. I cant use arrays as I dont want to predefine the size.
Get it?? Sorry for the ambiguity ....:(