The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [c++]

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

74 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
613 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 ...
5
votes
1answer
282 views

Best practice for grouping related constants

I'm working on Finite Element code in MATLAB, and the number of constants (for instance user input defining the geometry, physics, numerical solution scheme) is substantial. Currently, I've been ...
3
votes
1answer
143 views

different collision geometries in a component based game engine

I'm writing a simple game engine and after a lot of rethinking/refactoring I settled with sort of a component based architecture (not strictly ECS, but it isn't inheritance based anymore either). So ...
3
votes
0answers
79 views

Dynamically load user code from a common library

My project aims to provide a common interface between multiple different HDL simulators, so users can write test benches that will work no matter the simulator used. In this situation, it is the ...
3
votes
0answers
78 views

Creating bindable input handler in C++ spanning two separate modules

I have a wxWidgets application. This is the first, main module. The second module is an openGL engine. It's a model-view-(controller) structure, where application is the view (and the controller), ...
3
votes
1answer
3k views

How to improve a pattern 'enum class with methods'

Over many years, I always find myself reconsidering this design, so I wanted to get some feedback on my solution to it. Problem: I need a limited amount of objects = instances from a class, and I ...
3
votes
0answers
763 views

Python and C++ repository structure

I'm refactoring the directory structure of a large Python repo that has a few dozen C and C++ files littered throughout. Is there a suggested architecture for a Python package that contains C/C++ code ...
3
votes
0answers
167 views

Design Pattern for Internal Builder

There is an object which is very complicated to build and many algorithms needed to figure out how it should be created (for your curiosity it is an object that represents and draws the beaming of ...
3
votes
0answers
426 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-...
3
votes
0answers
81 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 ...
3
votes
0answers
65 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 ...
3
votes
0answers
649 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 ...
3
votes
0answers
255 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 ...
2
votes
1answer
159 views

How to best unify different data formats?

I have a hardware device connected to the computer and on the hardware device there is 512 bytes of memory for storing parameters. I want to read this data and decode the parameters stored in the ...
2
votes
0answers
41 views

Managing application versions using Conan and RPM

I have a shared object that I developed. This shared object is packaged in two forms, a Conan package, and an RPM. It is a Qt project, so it has a .pro file associated with it. Up until now, we ...
2
votes
0answers
89 views

C++ dependency management across projects

We are developing a benchmarking framework in C++, with Make and CMake as build tools. The aim of the framework is to allow others who build algorithms to perform head-to-head comparison against prior ...
2
votes
3answers
194 views

Best way to conditionally exclude unused code (C++03)

I'm working on a bare-metal embedded system, with a class that can be compiled for different hardware versions. The class takes in a pointer to a device and uses it, or takes in NULL if the device is ...
2
votes
1answer
205 views

Suggestions for documenting namespaces with Doxygen

Consider several C++ classes which are all defined in a particular namespace. For cleanliness, each class is located within its own file, and are each well-documented. For the purposes of completing ...
2
votes
0answers
101 views

Access modifiers in combination of interpreter pattern with template method pattern

Motivation: (Skip to "The Problem" if you don't need motivation for it) As a project for myself, I'm writing an expression parser for certain kinds of mathematical expressions, and I'm using the ...
2
votes
0answers
594 views

How to organize project code with googletest?

Generally, we like to have a common folder for common header files to be shared among various projects in solution but what about googletest since it needs access to all header files of project to ...
2
votes
0answers
207 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
281 views

Designing a multithreaded TCP/UDP server for audio sharing

As briefly introduced in the question title, I am trying to design and implement a server application able to let clients share audio contents between themselves. In order to achieve that, I decided ...
1
vote
0answers
573 views

Unit testing C++ in XCode

I'm working on a plugin for some drafting software. The plugin takes the form of a dynamically loaded mach-o bundle. The software vendor provides a template plugin in the form of an XCode project. ...
1
vote
0answers
94 views

Save data from multiple Qt components scattered around multiple QML files

I would like to save the current "value" property of several components (e.g. a Slider) as a configuration profile when the user clicks on the Save button in my application. However, the Save button ...
1
vote
1answer
71 views

Processing data in a cluster with multiple tasks

The goal is to provide a scaleable system implementing multiple data processing tasks which can be seen as a graph. Data objects will travel that graph. Most object will visit the same nodes in the ...
1
vote
0answers
33 views

Applying an overloaded/templated function depending on the type of a QVariant

I'm trying to take a QVariant (in this case from a QProperty generated on a class) and based on the type, return a QWidget that allows for it to be edited appropriately. a signature for the ...
1
vote
0answers
295 views

Inter-system communication design on Windows (C++)

I was wanting to create a program consisting of 3 elements: A central component with no UI which will work on HTTP traffic and trigger one or more “worker” elements as needed A monitor component ...
1
vote
0answers
51 views

How should I set up the listener service for a dynamic user interface?

So I'm working on a project and I'm running into conceptual problems in creating my user interface. It's for a DirectX11 multi-monitor game I'm writing. I've got a prototype working, with entity ...
1
vote
0answers
162 views

Is the readability of file list in IDE a reason to keep empty .cpp file?

Sometimes I just need .h but not .cpp file, eg : interface class or enum class, and when the class list is displayed on file list of IDE (eg:Xcode): Animal.cpp Animal.h Cat.cpp Cat.h Dog.cpp Dog.h ...
1
vote
0answers
180 views

Server design: How should the server communicate with the rest of the program?

I've been trying to learn how to handle network input in C++ (using asio for networking). Right now I'm trying to build a program which should be able to receive commands and data from a client ...
1
vote
0answers
332 views

Low latency, multi-client producer/consumer. C++ on Linux

I am looking to replace a framework from the ground up. It works as it is, but I've been tasked with understanding it, so I want to know if anyone else recognizes any glaring design issues that I ...
1
vote
0answers
248 views

Dependency injection in the template class

I have a template wrapper class around the container std::priority_queue that supports multithreading. The short version of it is below. In this class I employ the function IsReady() that checks ...
1
vote
0answers
113 views

Alternative to reorder c++ tokens

Our organization is looking to standardize the way we use const T& and T const& and while we initially looked at clang-format to solve the job, it doesn't reorder tokens so there is no way to ...
1
vote
0answers
92 views

Receiving events through an interface

So I'm writing a game and using the Google Play Services framework to send and receive data. I have to implement the IRealTimeEventListener interface and override the functions below to receive ...
1
vote
0answers
144 views

Design: Mixing-in different functionality into class hierarchy in C++

Assume I have a sort of Observer-Pattern, where message objects are sent to observers. So I have say class Message as the top of a hierarchy and observers working on them. Concrete messages are ...
1
vote
0answers
76 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 ...
1
vote
0answers
101 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
1k 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 ...
1
vote
0answers
191 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
191 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
102 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
740 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
169 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
318 views

why c++11 define closure as a process of capturing variables

when using closure in other languages, it just feels nature, variables from outer scope are captured automatically , without the need of declaring such captures. in c++11, good to see we have ...
0
votes
0answers
47 views

C++ client-server design

The context I need to design a Client-Server(-Client) network in C++ that would allow an android application to communicate to a Raspberry Pi and back I am running everything on linux environment(s) ...
0
votes
0answers
36 views

Which components of an HTML Element, can I assume will be static over the course of its lifetime?

This is a question for people who are familiar with how HTML typically is built and behaves on webpages. Backstory and requirements I am building an HTML tracker with a C++/Qt backend. I am trying ...
0
votes
0answers
59 views

Using virtual inheritance for an interface system based on abstract classes

I want to use a physics engine (like bullet or PhysX) in my program, however I want to hide the actual physics engine from it, so I can easily swap it out with another during run-time (e.g. switch ...
0
votes
0answers
107 views

multithreading - waiting on a condition without using locks (c++11)

i've been wondering about it for a while now but never found any answers. is it possible to use something like a condition variable without a lock? I have a vector of objects, and a thread pool, and ...
0
votes
1answer
233 views

Handling Different Parameters for Derived Classes

I'm designing an API and I ended up having a few pure abstract classes. Because of the nature of the problem that I'm solving, each derived class has to be initialized with different sets of ...
0
votes
0answers
91 views

Base class with bool flag to imitate virtual constructor

I am using bool flag to call base class function when needed to imitate virtual constructor. I am using this way for inheritance purpose. I have a Base class constructor with int and bool. The bool ...