To all,

I will try to keep this scenario simple. I want to try to create a class having the following design:
Code:
                            **************
                            **  Animal  **
                            ** Abstract **
                            **************
                                  |
                                  |
                            **************
                            ** Species  **
                            **   Base   **
                            **************
                                /    \
                               /      \
                    **************  **************
                    **    Dog   **  **    Cat   **
                    **************  **************
My thoughts are that everything sould be created in terms of an animal where the Animal class should be able to create other Species that are of type Dog and Cat. Dog and Cat should have the ability to access properties (methods and data types) from species. But I currently can only figure out how to create Dogs abd Cats from Species having NO access to Species data types. What am I doing wrong?

I have provided some sample code as to what I am doing. The Cat class has been removed to shorten the listing however it is the same code as Dog (just change Dog to Cat).

main.cc
Code:
#include "animal.h"
#include "species.h"
int main() {
  Species species1( new Cat, new Dog );
  species1.print();
  return ( EXIT_SUCCESS );
}
animal.h
Code:
#ifndef _ANIMAL_H_
#define _ANIMAL_H_
#include <iostream.h>
#include <string>
#include <cstdlib>
class Animal {
 public:
    Animal() {}
    virtual void print( void ) = 0;
    virtual string get_name( void ) = 0;
};
#endif
species.cc
Code:
#include "species.h"
Species::Species( Animal *pG ) {
    pCat = 0;
    pDog = 0;
    pGeneric = pG;
    name = "SPARKY";   //  <---- To simulate some type of data type needed by Dog and Cat.
}
Species::Species( Animal *pC, Animal *pD ){
    pCat = pC;
    pDog = pD;
    pGeneric = 0;
    name = "SPARKY";
}
void Species::print( void ){
    cout << "Name=" << name << endl;
    if ( pCat != 0 ) { pCat->print(); }
    if ( pDog != 0 ) { pDog->print(); }
    if ( pGeneric != 0 ) { pGeneric->print(); }
}
Species::~Species(){
    if ( pCat ) { delete pCat; }
    if ( pDog ) { delete pDog; }
    if ( pGeneric ) { delete pGeneric; }
}
string Species::get_name ( void ) {  // <--- To simulate some type of method needed by Dog and Cat.
  return ( name );
}
species.h
Code:
#include "animal.h"
#include "cat.h"
#include "dog.h"
class Species {
 public:
    string name;
    // Constructor(s)
    Species( Animal *pG );
    Species( Animal *pC, Animal *pD );

    virtual void print( void );
    string get_name ( void );

    // Destructor
    ~Species();
 private:
    Animal *pGeneric, *pCat, *pDog;
};
#endif
dog.cc
Code:
#include "dog.h"
Dog::Dog(){
    color = "brown";
}
Dog::Dog( string s ){
    color = s;
}
Dog::~Dog(){
}
void Dog::print( void ){
    cout << "Dog = " << color << endl;
    cout << "Dog Name = " << get_name() << endl;
}
string Dog::get_name( void ) {
  string s = "UNKNOWN";
  //string s = Species::get_name();   // <--- I would have expected some thing like this but it is WRONG!
  return ( s );
}
dog.h
Code:
#ifndef _DOG_H_
#define _DOG_H_
#include "animal.h"
#include "species.h"   // <--- I would have expected some thing like this.
class  Dog : public Animal {
 public:
    string color;

    Dog();
    Dog( string s );
    ~Dog();
    void print( void );
    string get_name( void );
};
#endif
Code:
The Code for cat.cc and cat.h is the same as dog.cc and doh.h.
Thanks to any and all that respond.

DeadPoet