Questions tagged [abstract-base-class]

In OOP (Object Oriented Programming), a base class that cannot be instantiated because some of its declared methods lack a definition, which is intended to be provided by derived classes. The term may have more specific or slightly different meaning according to the particular computer language involved.

109 questions
0
votes
1 answer

C++ Copy construct base class pointer

Searched around and couldn't find any advice to my problem. I'm trying to make a copy constructor for a class that has a private variable that includes a pointer to an Abstract Base Class. #include "BaseClass.hh" ClassA::ClassA() { } /* Copy…
-1
votes
2 answers

C++: Segmentation fault - Calling function through std::vector<> using a virtual function and abstract class

This may be a total obvious error for some, but I can't seem to find out why this segmentation fault happens. I do understand that segmentation faults occur when accessing an address that my program should not access. First, I have this base-class…
-2
votes
1 answer

Is there a way to declare members of an abstract base class that are the type of the derived class?

Suppose I have an abstract base class that I want to declare members in that will match the type of the classes that derive from this base class. public abstract class BaseClass { protected BaseClass parent; } public class DerivedClass1 :…
Kyle Delaney
  • 11,616
  • 6
  • 39
  • 66
-2
votes
1 answer

AttributeError not generated in case of passing method reference

I have one simple doubt with respect to python 2.7: I have created an abstract base class and a child class: from abc import ABCMeta, abstractmethod class Base: """ Abstract base class for all entities. """ __metaclass__ =…
vKohli
  • 97
  • 1
  • 7
1 2 3 4 5 6 7
8