I'm almost sure the answer is simply no, you can't do that.
So I'm working on options for my app.
I've got a decent setup so I have the global options and the local options since you can have different options selected on different tabs.
For the global options I want to represent when an option isn't consistent across all the tabs by r...
Hello folks, a question about class design. Currently I have the following structure:
abstract Base Repository Class
Default Repository implementation class (implements some abstract methods, where logic is common thru all of the Specific classes but leaves other empty)
Specific Repository implementation Class (implements what is left...
Is there any issue with partially overriding a set of virtual functions defined by a base class?
My compiler provides the following warning:
overloaded virtual function "MyBaseClass::setValue" is only partially overridden in class "MyDerivedClass".
The classes look like this:
class MyBaseClass
{
public:
virtual void setValue(int...
I would like to have your opinion as to the pros and cons of using delegates instead of virtual functions aud subclassing?
...
I'd like to write a group of class D_I (aka I=1,2,... just I mean '_I' to be class proper name, not integer) which handle some (boolean, for example) operations F with same meaning for all classes. But also I want to operate with "sums" of object of such classes, different classes of the group might be "added" together. Mentioned operati...
Hi,
I am new to this website and I am trying a simple inheritance example in C++.
I checked my code lots of times and I really see nothing wrong with it, however the compilers gives me errors:
my code:
#ifndef READWORDS_H
#define READWORDS_H
using namespace std;
#include "ReadWords.h"
/**
* ReadPunctWords inherits ReadWords, so MUST...
I want to know if a class can inherit from a class and and interface.
The example code below doesn't work but I think it conveys what I want to do.
Does anyone have any recommendations??? The reason that I want to do this is because at my company we make USB, serial, Ethernet, etc device. I am trying to develop a generic component/inte...
I was trying to solve a problem, but found a different solution.
however out of curiosity like to know if the following is possible:
template< class > struct S;
template< > struct S< Foo > : struct< Foo > {};
I would like to be able to inherit nonspecialized struct from specialized struct.the example above does not work because the in...
I am working on a small project using Entity Framework. I have a Group entity and a MissionTrip:Group entity (and also a SmallGroup:Group entity but that shouldn't be necessary information). I am using Table-Per-type inheritance set up analogously to the inheritance in this blog post by Muhammed Mosa.
I can't save a MissionTrip to the G...
I know that you can't use inheritance with enums, so in my base class I want to define that the classes that implement it must return an enum of some type for a property.
Ideally, this would be like:
public abstract BaseEnum MyEnum { get; set; }
Then all the implementers would have to return some form of enum. But obviously BaseEnum ...
Well first of all sorry for the English.
I have the following problem: I have a base form with a panel docked to the bottom and inside the panel some buttons. The forms inheriting this base form can modify the visibility of the base form buttons by properties like "ButtonCloseVisiblity" that appears in the child form properties. The prob...
Wikipedia on the diamond problem:
"... the diamond problem is an ambiguity that arises when two classes B and C inherit from A, and class D inherits from both B and C. If a method in D calls a method defined in A (and does not override the method), and B and C have overridden that method differently, then from which class does it inheri...
Hello all,
I have the following situation in my python code:
class Parent(object):
def run(self):
print "preparing for run"
self.runImpl()
print "run done"
class Child(Parent):
def runImpl(self):
print "child running"
However, I have several such 'decorators', doing different setup/teardown ste...
What is the easiest way to make C# not instantiate a class unless inherit?
Sounds weird but i dont want to explain the why. I have a base class and two class that inherit it. I want to use the derived class only and not the base. The derive class does not have any extra functions. Whats the easiest way to NOT allow me to write new BaseC...
Is there a specific rule on how Overriding equals() & hashCode() in sub classes considering super fields ?? knowing that there is many parameters : super fields are private/public , with/without getter ...
For instance, Netbeans generated equals() & hashCode() will not consider the super fields ... and
new HomoSapiens("M", "80", "1...
Why does cocoa use delegates rather than inheritance?
...
I'm trying to enforce an inheritor of an abstract class to initialize one of the fields in the base.
I can't do this via a constructor in the base because the type of the field requires a reference back to the object creating it. (I suppose I could provide a parameterless ctor for the field type. But I feel that would just be shifting t...
I have a questing around such staff.
There is a class A which has a object of type class B as it's member. Since I'd like B to be a base class of group of other classes I need to use pointer or reference to the object, not it's copy, to use virtual methods of B inside A properly. But when I write such code
class B
{public:
B(in...
Hello,
I'm trying to define the inheritance-check predicate is_a/2 in Prolog, but so far all my trials failed.
The is_a(X, Y) predicate should return true whenever Y is a superclass of X. For example:
object(bare).
object(mammal).
object(animal).
object(bird).
is_a(bare, mammal).
is_a(mammal, animal).
is_a(bird, animal).
is_a(X, Y):- ...
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <string>
class Helper
{
public:
Helper() { init(); }
virtual void print() {
int nSize = m_vItems.size();
std::cout << "Size : " << nSize << std::endl;
std::cout << "Items: " << std::endl;
for(int i=0; i<nSize; i++) {
s...