Questions tagged [base-class]

In Object Oriented Programming, a base class is one from which other classes inherit. For example, a child-class `Male` and another child-class `Female` may both inherit from the base-class `Human`.

In Object Oriented Programming, a base class is one from which other classes inherit. For example, a child-class Male and another child-class Female may both inherit from the base-class Human. As a result of such an inheritance, each of them will have at least all the attributes and methods of the class Human and perhaps a few others.

678 questions
0
votes
1 answer

gdb breakpoint on base class, but failed

in mongodb, class cursor is defined as 'Cursor : boost::noncopyable', and then there are many class which are derived from it. I want to know for a given operation from client, which XXXCursor was used. so I want to set a breakpoint on…
zhihuifan
  • 1,093
  • 2
  • 16
  • 30
0
votes
0 answers

Base class that implements a way of comparing properties of the derived class

I am repeating myself, and violating DRY. What I need is a base class that implements the operator == and != and GetHashCode and Equals. The base class must list all properties (through reflection?) of the top most derived class. And compare these…
Mike de Klerk
  • 11,906
  • 8
  • 54
  • 76
0
votes
4 answers

Java - Automatic function selection using base class

Simply put, I have the following code, is there any better way to do this? Also, I cannot modify any of the recipe classes. public static ShapelessRecursiveRecipe convertRecipe(Object o) { //might be a better way to do this if(o instanceof…
user1725869
0
votes
0 answers

Building object files which depend on other object files (C++)

I have a file, Matching.cxx, which contains some class method definitions and some other functions. It contains calls to many other classes. In my makefile I create object files for al of the other classes first and then attempt to make Matching.o.…
JMzance
  • 1,704
  • 4
  • 30
  • 49
0
votes
2 answers

ef get fields only in base class

public class baseEntity { [Key] public int ID { get; set; } public string Name { get; set; } } public class ProjectEntity : baseEntity { public string Address { get; set; } public string PhoneNo { get; set; } } public class…
iwaitu
  • 205
  • 1
  • 2
  • 8
0
votes
2 answers

Multiple base classes for one derived class, inheritance in C#

If I have a class with two base classes : public partial MyClass : Base1, Base2 { } To call the constructor of Base1 I would do this: public MyClass() : base(myParamForBase1); But I need to call the second base class to get the base init…
anpatel
  • 1,952
  • 4
  • 19
  • 36
0
votes
1 answer

Resharper BaseTestClass in other project/assembly

I am unit testing and have a base testclass that include a testmethode that should be inherited by the implementing testclass. if the base test class is in the same project as the inheriting class the base testmethode is recognized and executed…
Tobias
  • 2,945
  • 5
  • 41
  • 59
0
votes
2 answers

C# OOP Abstract base class and inheritted properties

apologize me if this is noob question. I have the following abstract base class: public abstract class MockDataBase { public virtual string ExternalId { get; set; } And i have the derived class: public class UnitMockDataBase: MockDataBase { …
ilansch
  • 4,784
  • 7
  • 47
  • 96
0
votes
1 answer

C++ Calling a DerivedClass function not inherited from a BaseClass pointer

Hello and thanks in advanced. Here is my issue. I have these classes: -class Date -class Contract -class Employee -class Node -class List All of the classes derive from this class BaseObject. It has this code: #ifndef BASEOBJECT_H #define…
0
votes
3 answers

no matching function error in the case of relation between base class and extend class

I got two classes: TJob and Reload_Job. Reload_Job extends from TJob: class reload_job: public TJob I got a function: void run_all_threads(std::vector &jobs){...} and a call: std::vector
khanhhh89
  • 317
  • 5
  • 19
0
votes
3 answers

Calling a base class method from a derived class method in Python

I have a class A and I have inherited a class B from class A. I have two methods methodX & methodY in ClassA. This methodY will be calling methodX in classA. Now I have a methodZ in ClassB. The following is the scenario:- class A(object): def…
a4aravind
  • 1,202
  • 1
  • 14
  • 25
0
votes
3 answers

How to avoid the fragile base class in Java

I am studying the fragile base class problem and found the following paper interesting: https://www.research.ibm.com/haifa/info/ple/papers/class.pdf In this paper it is argued that it would be great if Java had a 'sealed' access modifier; not like…
user1128272
0
votes
2 answers

template operator overload base class

I have a base class with many child classes. How would I implement a template operator over loader in the base class to work for all the inheriting classes? I tried to make one with the + operator but it complained that I had too many parameters.…
jay
  • 477
  • 1
  • 9
  • 17
0
votes
4 answers

Issue with inheritance and virtual destructors in C++

So I have two classes, one is abstract, and one is not. The abstract class is Iterator, and the concrete one is LinkedListIterator. The code for both is at the bottom of the post. The issue I'm having is with the code as it is below, I get 1 error…
Ethan
  • 1,206
  • 3
  • 21
  • 39
0
votes
1 answer

DDD Events and abstract base classes

I am currently working on implementing multiple events which share common properties and are basically the same: Templates. Our event provider applies several events like SomeTemplateAddedEvent and SomeOtherTemplateAddedEvent. There could possibly…
TheGuest
  • 415
  • 1
  • 4
  • 14