Skip to main content
1 vote
2 answers
118 views

Can't convert Supplier<S> into Supplier<?>

I have a very simple Java class that looks like this public class StatementRegister { public static final Map<String, Supplier<Statement<?>>> registry = new HashMap<>(); ...
slit bodmod's user avatar
1 vote
2 answers
97 views

C++ template class as a member in a normal class

I'm creating GPIO abstraction driver for stm32. There should be a class with register accesses and another class that holds a reference to it. In that way the class holding a reference has no idea ...
Nik's user avatar
  • 11
2 votes
1 answer
113 views

How to implement abstraction/encapsulation; like a generic/opaque struct that holds a platform specific window

typedef struct { WindowData data; bool vsync; } Window; typedef struct { Window window; GLFWwindow *native_window; } WindowsWindow; Window *windowCreate(const WindowProperties props,...
Aidan's user avatar
  • 87
0 votes
2 answers
72 views

How to extend ThemeData and override a property type

I am using ThemeData's "extensions" property: ThemeData( ... extensions: <ThemeExtension>[ CustomThemeExtension( ... ), ... ), by looking at its definition: Iterable&...
Fi Li Ppo's user avatar
  • 320
3 votes
2 answers
237 views

How to write an abstraction in Rust with multiple implementations

In my application I want to have an EventPersister trait that defines an abstraction of persisting events, then have various implementations that, for example, persist events in memory, in the file ...
bikeman868's user avatar
  • 2,685
-2 votes
2 answers
129 views

Recursively instantiating the classes inside an object

I want to activate, via reflection automatically and recursively all the nested classes inside a class I am instantiating. Here is the template of what I am trying to do, but I do not know how to make ...
Jada's user avatar
  • 23
6 votes
1 answer
491 views

How can I determine the type of a tuple's elements directly from its type name in Swift?

I have been exploring different abstractions in Swift, and I found myself stumped on how to determine the type of a tuple's element from its own type. I know the compiler and Xcode are quick to ...
PipWasHere's user avatar
-1 votes
1 answer
60 views

Generic types in abstract classes

I am looking for a C# solution that allows me to create a base class (AParam) whose inherited classes (Param) can be generic in order to implement different, type-dependent versions of a function (...
Simon Spielmann's user avatar
-1 votes
1 answer
60 views

dynamic size SoA_container with AoS Access

I found this idea in the paper Abstraction for AoS and SoA Layout in C++ by Robert Strzodka (PDF) for applying a AoS (Array of Strucures) access to an SoA (Structure of Arrays) container without ...
PyOPTProblem's user avatar
0 votes
1 answer
238 views

How do I create an abstract or base Notifier class in Riverpod?

I have multiple notifiers with similar search and other logic, the only difference being the API call. How can I abstract that logic out? And reuse my Notifier in multiple places? Example : ...
Burhanuddin Rashid's user avatar
2 votes
1 answer
86 views

C++ factory of a container type without defining the container element type

Based on this topic, I wonder if it would be possible to have a factory class that would provide a container type, without defining the type of element of the container. Something like: template <...
canellas's user avatar
  • 747
-1 votes
1 answer
61 views

Abstraction vs Encapsulation , not the bookish definition , real world examples

I have searched about this topic everywhere that what's the difference between abstraction and encapsulation , even one of the most voted stack overflow question , but at the end it seems confusing ...
RISHABH SHANDILYA's user avatar
1 vote
2 answers
201 views

SYCL NDRange and Hierarchical: Why one of them is not enought?

SYCL offers NDRange and Hierarchical kernel parallelism abstractions. My questions: Is it true to claim that NDRange better mapped into GPUs hardware and Hierarchical parallelism better mapped into ...
Ami's user avatar
  • 21
-1 votes
2 answers
64 views

Efficient way to abstract multidimensional ArrayList to Collection

I have a class that returns an ArrayList of ArrayLists. I would like to return a Collection of Collections to abstract the output datatype. With a standard ArrayList, its easy - just define the return ...
ecc521's user avatar
  • 667
0 votes
1 answer
137 views

How can I programmatically decide what class to create an object as?

I want to write code to communicate with encoders of different positioning styles (absolute vs. relative). The idea I have is to create a base class that has things common to all encoders. Then there ...
tbickford's user avatar

15 30 50 per page
1
2 3 4 5
76