Questions about C++, a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

learn more… | top users | synonyms

1
vote
3answers
95 views

Implementing an event scheduler for animations

The basic idea is to have some animated widgets that sit in a container, quite similar to Qt (the only actual difference is that my widgets are animated). The animation is in some cases dependent on ...
5
votes
2answers
213 views

Why does ifstream.eof() not return TRUE after reading the last line of a file?

When a beginner starts off reading ifstreams, his/her instinct is to read the file using a loop that usually looks like this: while (!ifstream.eof() { ... } However, C++ programmers note that what ...
1
vote
2answers
111 views

Dynamic gesture recognition with fingertip points

I have built a fairly robust program in c++ which tracks several points on a hand. It accurately quantifies the size of the palm, the center of the palm, and the fingertip locations among other hand ...
0
votes
2answers
147 views

Compiling source code using c++

Last year, in university we used the library SDL to create a game from scratch. So I though of developping a game engine based on SDL. I will be using Qt to do the UI and SDL to implement the core of ...
0
votes
2answers
71 views

Best Communication strategy for monitoring dashboard

I have a requirement where I need to display certain stats on Admin Dashboard in my web application (Angular+Java). These stats (transnational data) are being generated on different servers (connected ...
0
votes
2answers
115 views

The way to implement a configurable (at run-time) default style

I am coding a visualizer of graph algorithms. Each vertex of the graph has a style (color, size etc.). As long as the algorithm has done nothing to a vertex, that vertex has a default style. The ...
-1
votes
1answer
812 views

Use of pdb file in release build executables

This question is appropriate only for programs created on the windows platform. If I build a release of my program with the /Zi option (create pdb file and store path to file in exe) then I don’t ...
-2
votes
1answer
752 views

Bresenham Vs Midpoint Circle drawing algorithm

Can somebody explain the difference between Bresenham and Midpoint Circle drawing algorithms? All I am able to understand is that in both algorithms we compute coordinates of an octant instead of ...
4
votes
0answers
92 views

Does it make sense to apply the principles in Redux to OO languages?

Redux is essentially functional programming, and it makes a lot of sense. As I move back to a non-javascript OOP language in a different project I would like to apply the same principles such as ...
4
votes
0answers
534 views

Dynamic programming in Bin packing

Problem: Given a list L of objects of possible sizes from set S={1,2,4,8} and unlimited supply of bins of sizes 16 each and we have to use minimum possible numbers of bins to pack all objects of L. I ...
3
votes
0answers
683 views

Is it rational to convert protobuf into json to send it to a web server?

Protobuf is a good thing, it allows c++ devs to not bother with class serialization/deserialization, is fast and .proto format is very nice. It also allows automatic data validation. But the messages ...
2
votes
0answers
75 views

Using and designing asynchronous APIs with naturally synchronous parts

I've been programming for a long time, but very rarely with anything asynchronous (and not often with anything to do with multithreading, either). Mostly for the fun of it, I'm writing a program to ...
2
votes
0answers
72 views

How to combine template and inheritance

I have multiple factories, each is responsible for creating instances of an inheritance tree. For example (syntax or semantics maybe incorrect), struct InterfaceA {}; struct ImplA1 : InterfaceA {}; ...
2
votes
0answers
103 views

What are the benefits of an input/output component design?

For the company I work at, all of our projects, including a new one started last year, are written in C89. We write for vxWorks (a real time embedded operation system). Our software runs multi-...
2
votes
0answers
61 views

Default move assignment and destruction order of members versus the rule-of-zero

Members must frequently be destroyed in the correct order. As member creation is in forward order and destruction is in reverse order this will usually work fine. However, when assignment operators ...
2
votes
0answers
133 views

Speed: Named Shared Memory vs Memory Mapped File vs Normal Memory

Let's say I have a server, where clients who connect are constantly updating their inventory. I could simply save the changes in to the database after an item has been updated, or I could update the ...
2
votes
0answers
44 views

How to architect rule matching with multiple conditionals and outcomes

I'm working on allowing my users to create their own ruleset for data that's coming in. All of the data below is sample mock data and not in relation to our product. Example of a rule (there can be ...
2
votes
0answers
56 views

Visual interpolations: independent or linked to object?

I have a class that I use to render GUI elements on the screen, this class has a tree structure (with children, parent, and siblings). I created an additional class which allows me to interpolate some ...
2
votes
0answers
163 views

Requesting information regarding the use of MUI vs. the use of GetText for i18n/L10n of Windows desktop applications

I have spent the past two days investigating which technology I will use to support translations of text strings (as part of an overall internationalization migration) for an archaic (VC6) Windows ...
1
vote
0answers
19 views

Zeromq bidirectional asynchronous transmission?

I have a system which consists of two applications. Currently, two applications communicate using multiple zeromq publish/subscribe sockets generated for each specific type of transmission. Sockets ...
1
vote
0answers
82 views

How to structure enum data to achieve the desired effect

I'm making a framework for building simple html websites for an embedded system and I want to make it bulletproof in a way that a user can't make mistakes in building the html document. As I've ...
1
vote
0answers
174 views

What is the “async desaster” Detlef Vollmann was talking about at Meeting C++ 2014?

I found the slides of his talk there: https://meetingcpp.com/tl_files/2014/talks/executors-meetingcpp.pdf In one of the last pages, he is talking about the "async desaster" (which I, as a non-native ...
1
vote
0answers
132 views

Switching from Node.js class techniques to C++

I'm going to be rewriting a project from Node.js into C++11. The device the Node.js scripts are being run on are ARM based, and Node.js is slow to start up on the device. In the Node.js program, I ...
1
vote
0answers
447 views

Integrate C++ DLL with C# GUI asynchronously (design issue)

This is more a design than an implementation question. I am aware of how to integrate a C++ DLL within a C# main app that acts as GUI. Believe me that I've read all other questions on similar topics, ...
1
vote
0answers
86 views

Pointers vs IDs for “context-specific” functions

I need to be able to load, use, and free resources from a single monolithic object. I have two requirements: 1. That the resource loaded is owned by the object that created it and 2. All objects in a "...
1
vote
0answers
260 views

Best software architecture for an efficient network tunneling in C++

Before jumping to my questions, let me explain my project's background. I am part of a team that organize the network of a famous LAN event. Most of the games nowadays actually don't run locally but ...
1
vote
0answers
88 views

Maximizing reuse out of a function primitive in CUDA

I'm working on the implementation of a few related algorithms in CUDA, all of which require a primitive that we'll call f(). The related algorithms can't simply call f though, as they require f to ...
1
vote
0answers
207 views

Mailbox Pattern with Variable Arguments in C++

In a game I'm developing, the GUI thread is catching user actions, and the simulation thread is responsible of handling and responding to them. To minimize complexity and delay, I predefined all ...
1
vote
0answers
330 views

In-place merging of sorted intervals in an array?

So I have code producing k sorted intervals in an n-sized array. What I'm brainstorming is the possibility of in-place merge of these intervals into a single sorted interval/array. The problem is ...
1
vote
0answers
121 views

Web Services of System Integration

I have been assigned to a system integration project. However, I do not understand part of the integration implementation architecture. For example, I have a passport scanner connected to a Windows ...
1
vote
0answers
131 views

Representation of time expanded graph

I want to build a time expanded graph with time discretization Dt that starts at t = 0 and ends at t = T where between the node (n1, t) and the node (n2, t') is an arc if and only if (n1, n2) were ...
0
votes
0answers
5 views

Can the C++ template system be used to perform type safe operations of the relational algebra

Assume that the parameters of functions representing operations of the relational algebra are represented by individual types: structs or classes. An operation such as (natural) join will have ...
0
votes
0answers
26 views

What's an optimal procedure to create a connected cyclic grid of nodes and edges for A* pathfinding

like the title says, I'm trying to create a grid of nodes that hold edges or connections to each other so I can perform A* algorithm to have objects traverse across them as seen in your standard RTS. ...
0
votes
0answers
51 views

Pointers on porting a c++ workflow domain specific language to javascript

I am writing a game in c++ with the v8 javascript engine embedded in it. I have a c++ workflow system I use to tell things how to do specific things. It's nice and I like it, but I need it to work ...
0
votes
0answers
49 views

Should frequent Fonts, Colors, Pens etc be “Cached”

I am creating a game, currently everything redraws every 50ms, and that involves quite a few Gdi Objects. Here: Gdiplus::Pen outlineScrollPen ( Color (200, 0, 0, 0), 4 ); ...
0
votes
0answers
22 views

Creating and passing new object in parameter

I have a wrapper class which contains a smart pointer (unique) which can point to objects which are subclasses of State. Each subclass of State receives a reference to the wrapper class so that the ...
0
votes
0answers
86 views

Building a heap in C++

I am learning heaps in C++ and I have a question about heapify function. So in order to build a heap from a random array, you put the elements from the array in a binary tree in order in which they ...
0
votes
0answers
75 views

Arbitrarily sized (and signedness) integer arithmetic in C++ - How can it be done generically at runtime?

How can I efficiently handle integers of unknown size and signedness in various arithmetical operations in C++? (for a virtual machine). I am storing the program for the virtual machine in a string ...
0
votes
0answers
114 views

What to unit-test when loading a dll?

I wrote a wrapper class that is using a dll. I have a LoadLibrary() function and have wrapped all the functions the dll exports (to match my error codes). I am not too familiar with unit testing. I ...
0
votes
0answers
44 views

Is it possible to maintain one code base and deploy on both spir/open-cl and ptx/cuda?

It is my understanding that both spir and ptx are based on llvm. Binaries can be generated by clang for use along with the native graphics compute drivers (e.g. open-cl and cuda). My question is ...
0
votes
0answers
88 views

How to improve the design pattern of this Screen Window system?

I have a Screen Window system, a Screen (IScreen as interface), which holds a window, either WindowA or WindowB. System can switch window by calling stateChanged: class IScreen{ public: virtual ...
0
votes
0answers
147 views

Qt / C++ internal API design for slightly similar web services

in my application I provide a Qt/C++ wrapper to certain web services based on the Danbooru software. Basically the API wraps a series of REST calls and produces / parses the JSON responses to display ...
0
votes
0answers
142 views

How can I automate updating code on an integrated device with files and a MySQL database?

I have an integrated device that has a program in it currently written in Node.js. So, naturally, there are a whole bunch of files that it needs to run. Also, there is a MySQL database that it uses ...
0
votes
0answers
77 views

Why are datatypes different in terms of bit size based on complier, and OS used

I was reading a tutorial on C++ as I am new to programming, and I was wondering why the sizeof operator gives different output depending on what you're programming with.
0
votes
0answers
56 views

Mocking delegate constructors

I am new to Unit Testing in C++. I am supposed to write a Unit test for my code and I am using Google Mock for the same. I have gone through their turtle example. But I am still confused as to how to ...
0
votes
0answers
83 views

Matching groups of similar lines on a generic matching algorithm

I have to write a program to search through a file containing lines and find lines that match to a degree of tolerance but are not necessarily the same. So for example the following lines would match: ...
0
votes
0answers
258 views

R* Tree work with dynamic data

I'm searching an algorithm to store my data (which are moving objects' coordinates) and allow me to query objects within a specific radius of a specific point. I came up with R* Tree which is said as ...
-1
votes
0answers
63 views

Integrating IDE with docker C++ toolchain

I have created a docker in order to compile C++ applications using a third party toolchain. My ideal work environment would be to leave the sources on my local directoy and to use the docker only for ...
-4
votes
0answers
52 views

how to create a pipeline code which interfaces between Borland and visual studio platforms?

what pipeline program will act as a interface between visual basic C++ builder and Borland 5.0 they must fulfill these- a C/C++ code which will be a pipeline method interfacing between C and C++ ...