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

How to get base properties and fields with values using reflection to work up the class hierarchy?

How can I get base class properties and fields using reflection, so that I can work UP the class hierarchy one level at a time? The goal is to build a tree display showing properties and fields with values of any class instance, just like the…
John_Sheares
  • 1,404
  • 2
  • 21
  • 34
0
votes
2 answers

Is this name lookup in dependent base class with VC++ 2010 non-standard?

The code below does not compile on Ideone or Codepad, yielding errors like: 'X' was not declared in this scope but it does on VC++ 2010: #include #include template struct Base { …
TemplateRex
  • 69,038
  • 19
  • 164
  • 304
0
votes
1 answer

cakephp model class extends base class then appmodel

I am trying to setup a simple ORM for cakephp so I want to do this App::import('Model','TheBaseModel'); class YourModel extends TheBaseModel { } class TheBaseModel extends AppModel { function OptionSetter() { } } But I want to put TheBaseModel in a…
user332951
  • 359
  • 1
  • 3
  • 18
0
votes
2 answers

Understanding the use of Interfaces and Base Classes

I know there are a number of post out there on Interfaces and Base classes, but I'm having a hard time getting the correct design pattern understanding. If I were to write a reporting class, my initial though would be to create an interface with the…
TreK
  • 1,144
  • 2
  • 13
  • 25
-1
votes
1 answer

Setting my base class with cache class

I am trying to build a cache class using the Ardalis Example http://ardalis.com/introducing-the-cachedrepository-pattern I am getting the error saying it has zero arguments. I can figure out how to pass the top part. The cache part of the class has…
Michael Hahn
  • 143
  • 1
  • 5
  • 12
-1
votes
2 answers

AS3 Base class is final error when I didn't set it that way

I'm getting the "Base class is final" error on a project that uses the AIR for iOS player. Problem is I didn't set the base class to be final. Also this only happens when I use AIR as the player. Main - document class package { import…
TreeTree
  • 3,200
  • 3
  • 27
  • 39
-1
votes
1 answer

Including base class variables in the initializer list in the derived class

My project is to create a dive logbook. There is the DiveInfo base class and Equipment derived class. The equipment may change from dive to dive, so obviously it needs to get the variables for specific dives, according to the given data by the…
kristof
  • 19
  • 4
-1
votes
1 answer

C++ Base class member creation via derived class

I'm having difficulties understanding the following code: class Base{ Base(){/* do stuff */}; }; class Deriv: public Base{ Deriv(){/* do stuff */}; }; // I have a problem understanding the purpose of the next line Base &foo = *(new…
-1
votes
1 answer

Passing objects of different derived class as a parameter to a function that expects base object of class

I have a base class Device and inherited class InputDevice. In class XYZ I have a function XYZ::setDevice(int num, Device device) that expects object Device as parameter. When I call the function setDevice() with parameter that is sublclass of…
-1
votes
2 answers

How can a user choose the implementation of an abstract class member variable in c++

I want users of my class "ShapeHolder" to be able to set the "Shape shape" member variable to be any class with the same interface (int w/h, getArea(), etc). Therefore, I believe I made the base class an abstract class by setting a function to…
user16541120
-1
votes
1 answer

reaseat shared_ptr from function accepting shared_ptr

I'm trying to reseat a shared_ptr of a derived class from a function that accept a shared_ptr of a base class. This answer is relevant, but it does not cover the fact that I need to reseat the pointer so a const reference cannot be used. Here is a…
mcamurri
  • 153
  • 11
-1
votes
2 answers

Not able to Start appium service from java code

Not able to start appium from code made a function and called before desired capability, post desired capability. Getting error while running below code: C:\Users\Ritesh Mittal\AppData\Roaming\npm\node_modules\appium\lib\appium.js:1 import _ from…
mittalri
  • 21
  • 3
  • 7
-1
votes
1 answer

I keep getting "cannot declare parameter '_inputVerifier' to be of abstract type 'InputVerifier'" error

I'm currently converting a project from Java into C++. I'm using base classes as interface classes and I'm using derived classes as a subclass of the "interface" class. Right now, I'm having an issue regarding base and derived classes. Here's some…
NickS
  • 1
  • 1
-1
votes
1 answer

Using Custom Attached Properties with Base Class and Generics

I wish to use AngelSix's custom attached properties Code in a .NET Framework 4.7.2 class library. However, when I try to add an attached property to an object in a Xaml file, what I get from Intellisense in Visual Studio is…
Dorogzz
  • 11
  • 1
  • 2
-1
votes
2 answers

Accessing derived class from base class pointer with a fixed array size

I'm trying to write a function parkVehicle(), this function has to access the read member function of the derived class through a Base class pointer. How can I access it? class Parking { const int MAX_SPOTS_NO = 100; Base B[MAX_SPOTS_NO]; …
beebo
  • 1
  • 1