C # How to reference a class inherited from a base class

I am trying to refernce an inherited class from a base class, here's an example of what I have: public class A { //Some methods Here } public class B : A { //Some More Methods } I also have a List<A> of which I've added B to, and I'm trying to acces

Construct subqueries of derived django fields

I have a few transformations I need to perform on my table before I aggregate. I need to multiply transaction_type (which is either 1 or -1) by amount to yield a signed_amount. Then I need to sum all signed_amounts by primary_category (which is a for

Architecture based on c ++ components

I'm having trouble figuring out a way to make a component based engine architecture in c++. But i cant figure out a way to combine a vector of components with a class that derives from component. I want to override components virtual function. But th

Derived SQL table

I am new to SQL and really struggle just testing it out. My question is how do I derive data from one table to a new one keeping only specific data like: -Real name -Screen name and also how do I create new variables using SQL. For example the Number

Avoid dynamic_cast with derived classes (Cast Derived class)

I am new to C++ and came to a point, where I generate an overhead with classes. I have a QTcpSocket and read messages from it and create objects, for example MessageJoin, MessagePart, MessageUserData etc. I send these objects to my client and display

c ++ inheritance class constructor

I have a slight problem where to be honest I am totally confused with derived class constructors and need some help. I have a base class with the parameterised constructor: Element::Element(RandomNumber &rnd, Console &console) : rnd(rnd), console(

c ++ Is a class derived from a specific class?

Is it possible what I'm trying to achieve. This is the problem: class Content{}; class Content1 : public Content{}; class Content1_1 : public Content1{}; class Content1_2 : public Content1{}; class Content2 : public Content{}; class Content2_1 : publ

Custom c ++ output stream with indentation

I'm having some trouble trying to implement a custom stream class to generate nicely indented code in an output file. I've searched online extensively but there doesn't seem to be a consensus on the best way to achieve this. Some people talk about de

Error C2660: Hiding Methods in a Derived Class

Goal: Sharing a base class with the same functionality except only a few descendants which merely hides methods (getters and setters) as they instantiate and free a protected or private pointer. Problem: When re-declaring the setter only I get this e

C # - Complete return of the basic method

I have a virtual base method void Action() that is overridden in a derived class. The first step in Action is to call base.Action(). If a situation occurs in the base method I do not want the rest of the derived method to be processed. I want to know

C ++: Can I write a template class derived from T?

I'm not exactly sure how to word this in English, but I want to do something like this: template <class T> class derived: public T { blah }; Where basically, I have a template class, but I'm deriving a new class from the class that is specified in t

Inter-DDL extension of an entity class

What I want to archieve: Service assembly (project) that holds EntityClasses - pure Data. GUI assembly that extends those Entities for its own pourposes - Runtime information for GUI. What I tried: Derivation (Gui defines class ExtendedEntity : Servi

Python derived from class and base class attributes?

There seems to be no good online documentation on this: If I make a derived class, will it automatically have all the attributes of the base class? But what's the BaseClass.__init() for, do you also need to do it to other base class methods? Does Bas

Replace an abstract property with a derived return type in C #

I have four classes. Request, DerivedRequest, Handler, DerivedHandler. The Handler class has a property with the following declaration: public abstract Request request { get; set; } The DerivedHandler needs to override this property so that it return

Erase type and accessors

I used type erasure pattern in C++, i.e I hide a template class with an abstract class class Base{ virtual ~Base(){} //pure virtual methods... }; template<typename T> class Derived : Base{ Derived<T>(){} ~Derived(){} //public methods... privat

Derived class of manipulation c + + which is self-referenced

So suppose I have a tree class like this in c++ class Node{ void addChild(Node*); /*obvious stuff*/ protected: Node* parent; vector<Node*> children } class specialNode : public Node{ void addChild(specialNode*); /*obvious stuff*/ /*special stuff*/ }

Subquery using a derived table in Hibernate HQL

I have a Hibernate HQL question. I'd like to write a subquery as a derived table (for performance reasons). Is it possible to do that in HQL? Example: FROM Customer WHERE country.id in (SELECT id FROM (SELECT id FROM Country where type='GREEN') deriv

c ++: dynamically choose which subclass to create

I am new to c++ and i have a question. Lets say we have a base class Base and two derived classes, Derived1 and Derived2. f.e. Derived1 has a constructor taking a integer and Derived2 a constructor taking a boolean. Is it possible to determine at run

simulate a virtual constructor in c ++

In my application I have to derive some classes from a base one, the problem is that I want to enforce the derived classed to have 3 particular constructor implementation. As c++ don't have virtual pure constructor, it seemed quite desperate (I had t

Derived constructor

In the following code: import java.io.*; public class MyClass1 { MyClass1() { System.out.println("base class"); } public void print() { System.out.println("base print"); } } class ChildClass extends MyClass1 { public ChildClass() { Sys