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
3 answers

Calling a base class method from a different base class that the child inherits

class A { void methodToCall() {}; } class B { B() { subscribeToEvent(); } void eventHandler(Event* E) { call A::methodToCall() } } class C : public A, public B{ } This may seem like a rare situation so let me explain what I'm trying…
kython
  • 3
  • 2
0
votes
1 answer

Create a base class for xmlpullparser utility in Android

I have some problem with parsing XML using xmlpullparser API for Android. Problem: I have a lot of duplication in Android classes like Activity or some business class for xml parser but it's the same! Required: some base class or util for…
Java Dev
  • 9
  • 2
0
votes
3 answers

An elegant way to pass derived type to base member template function?

I have a class called 'ValueChecker' which has the following member function: template bool ValueChecker::checkMe( std::ostringstream &oss, T &me) { std::cout << "Default checkMe() for " << typeid(me).name() << std::endl; return…
Bitdiot
  • 1,506
  • 2
  • 16
  • 30
0
votes
1 answer

Implementing convenience methods that use Controller protected methods?

Is there any way I can implement a convenience method that uses a Controller's protected method(s) without using a base controller, which is recommended against here? For example, I want to return an ActionResult based on whether a returnUrl query…
Jez
  • 27,951
  • 32
  • 136
  • 233
0
votes
1 answer

Where can I find the latest open source Base Classes used in Mac OS X like NSMutableDictionary, NSString, NS****,

do you know some links where I can browse the source codes of base classes used in Mac OS X? I already have this link which I found very useful but based from what I encountered lately (when using NSCache) it seems that it's not the latest source…
acegs
  • 2,621
  • 1
  • 22
  • 31
0
votes
3 answers

Base Class constructor error

Possible Duplicate: What is this weird colon-member syntax in the constructor? I have the following base class and derived class; class P { int n; public: P( int id ); virtual int getn(); virtual int toss( int x ) = 0; }; class RNP :…
John Smith
  • 27
  • 1
  • 9
0
votes
4 answers

Extending the Template Controller in Kohana

I'm having a bit of confusion in attempting to retroactively create a new base controller for my project. If I'm not mistaken, all I need to do is create a file in application/libraries called MY_baseController.php containing the following: class…
Sampson
  • 265,109
  • 74
  • 539
  • 565
0
votes
3 answers

Access base class fn with same signature from derived class object

Is it possible to access a base class function which has the same signature as that of a derived class function using a derived class object?. here's a sample of what I'm stating below.. class base1 { public: void test() …
Karthik
0
votes
4 answers

Child use of interface

I have a user control that will handle images on a form. But depending on what the source is (web cam or ID scan or other video source) the user control is different. But they share some common features so I want to create a base class. My other…
Brian Hanf
  • 544
  • 2
  • 11
  • 31
0
votes
2 answers

declaring a derived class in an IF for use outside

I have the following code where I want to declare an object inside an IF statement. I understand that just declaring it inside an IF means that it's outside the scope of the rest of the program. So I think I need to use a pointer. My problem is that…
YMDW
  • 411
  • 1
  • 5
  • 16
0
votes
1 answer

Generic class of a certain base class and also inherit base class

I'm trying to create a simple DataContainer class, public interface DataObject { string Name { get; set; } uint ID { get; set; } } [Serializable()] public class DataContainer where T : DataObject { } ...but if I want DataContainer to…
Deukalion
  • 2,516
  • 9
  • 32
  • 50
0
votes
1 answer

non-abstract class does not provide implementation for abstract method

I have a base class like the following. TMakerObject = class ... public method Clone:TControlObject; virtual; abstract; end; I want to make the method clone abstract. So, base class doesn't need to implement or define this method. However, the…
ThN
  • 3,235
  • 3
  • 57
  • 115
0
votes
2 answers

Generate a generic base class for a static class

I have a static class (VS 2010/C#) used to generate pdf documents from a template. We use iTextSharp APIs to generate the pdf. The class is static, providing only a public method to generate a specific document. Now we need to implement a new…
Francesco
  • 9,947
  • 7
  • 67
  • 110
0
votes
1 answer

Base class DTO or derived class DTO in service contracts

What's the better approach: using derived class in the service contracts (interface)? Or using the less specific class (the base class)? Suppose I have the base classes RequestDto and ResponseDto, all other classes inherit from one of them. Is it a…
riadh gomri
  • 869
  • 1
  • 15
  • 21
0
votes
0 answers

How do I call generic derived class functions from a function without explicitly stating what it is

I am not a C++ guy, but I am trying to learn. I do not really know the lingo, so I am not sure what to search for, or how to ask this question. The best I can do is present the following example: Define a generic class: class IPlugin { public: …
matt
  • 170
  • 1
  • 14