Questions tagged [wrapper]

A wrapper is an OOP technique where an object encapsulates (wraps) another object, hiding/protecting the object and controlling all access to it.

Filter by
Sorted by
Tagged with
3 votes
0 answers
77 views

Simple Network Time Server in C++ with improvements from prior code analysis

From code review: OO simple network time server with changes from a previous code inspection and added Windows support I made many changes as per the review comments. The code has been significantly ...
arcomber's user avatar
  • 2,449
5 votes
1 answer
196 views

OO simple network time server with changes from a previous code inspection and added Windows support

I put up my SNTP Server code for review here: SNTPv4 server based on rfc 4330 in C++ a fortnight ago and since then I have made changes as per code review comments and also added support for Windows, ...
arcomber's user avatar
  • 2,449
6 votes
1 answer
126 views

SNTPv4 server based on rfc 4330 in C++

Please review my SNTPv4 server based on rfc 4330 I tested running 3 instances of ntp-check.exe from Galleon systems and 1 instance of Microsoft w32tm - w32tm /stripchart /computer: No crash! This is a ...
arcomber's user avatar
  • 2,449
1 vote
0 answers
54 views

Using a decorator for init in Python3+Pyside6, to avoid writing boilerplate code [closed]

I'm building a GUI application with Python3+Pyside6 and have many QDialog classes that are similar, and i was looking for a way to avoid having to rewrite the same ...
sunyata's user avatar
  • 111
4 votes
3 answers
514 views

Auctionsite API Wrapper in Python

This is the first API wrapper I've written and I'm wondering what I can do to improve. I've read through the feedback of a few similar posts Readme Code ...
holts-shoe's user avatar
1 vote
1 answer
105 views

Class that wraps a collection and tracks if its elements were visited

The VisitedCollection is a collection wrapper for setting and tracking if elements were visited (removed in terms of the wrapper) I have concerns regarding: should ...
triclosan's user avatar
  • 254
9 votes
1 answer
1k views

Porting C-style socket to CPP class

I am porting the C-style socket to design a simple wrapper around the telnet client in CPP. The telnet protocol is accomplished by using libtelnet in C. The C-style code for this wrapper is reviewed ...
ravi's user avatar
  • 429
4 votes
4 answers
474 views

Functions in PHP to run basic MySQL crud

I wrote a list of functions in PHP that I want to use in my pet project as an autoloaded file for all parts of the app. The purpose of these function is to shorten the code you write for MySQL queries ...
Syed M. Sannan's user avatar
2 votes
1 answer
222 views

The receive function for telnet client

This is a follow up question to Send and receive functions for telnet client. I am designing a simple wrapper around the telnet client using libtelnet for text-based communication to a telnet server. ...
ravi's user avatar
  • 429
0 votes
1 answer
237 views

Common interface for fixed-length and variable-length lists in C#

I am working on library project in which I am reading and writing binary files that have own file format structure. In that structure there are variable-length and fixed-length elements. My approach ...
shjeff's user avatar
  • 185
0 votes
1 answer
98 views

C++20 Wrapper class for an unsigned integer type and a templated derived class that codes modular arithmetic type

The context is a library to represent numbers (in this case integers) by wheighted position by radix powers for every radix R, passed as template argument. These derived types are digits of radix R, ...
Earendil's user avatar
1 vote
0 answers
32 views

Wrap an ssh2 connection neatly and pass commands

I want to structure this better but don't think I'm handling results well. I'm used to python and I think my flow is way off. Is this bad design? Should my results be Result<String, Error>? I'm ...
shaciaran's user avatar
0 votes
1 answer
91 views

Data Wrapper Class with Automatic Saving and Locked Read/Write Accessors

This is a wrapper for a synchronized data structure that: Saves periodically Keeps track of dirty flag automatically (set when a write access is requested) Maintains a lock on data Only allows access ...
CaptainCodeman's user avatar
2 votes
2 answers
508 views

Wrapper class to get pairs in range-for loop

This code implements a simple wrapper, intended to be used with range-for to manipulate items of a container as overlapping pairs, ie. 3 items will give 2 pairs. Code review focus: Is ...
hyde's user avatar
  • 205
3 votes
1 answer
101 views

Abstract wrapper for fundamental types

I have created this interface as part of my C++ learning path. This post inspired me a lot. The idea is to use its concrete implementations to perform some actions before and after any change of the ...
EmaPrn's user avatar
  • 31
2 votes
1 answer
484 views

Thin C++ wrapper for sqlite3 C library

I originally wrote a rough C++ wrapper of the sqlite3 c library which did not use prepared statements. This code is my attempt at using prepared statements. I have attempted to make the wrapper as ...
arcomber's user avatar
  • 2,449
-1 votes
2 answers
130 views

Using a lambda to generically create an arbitrary class wrapper around some object of type T [closed]

While experimenting with some of C++'s language features, I was able to successfully design an invokable nameless function call through the use of a lambda that generically creates an arbitrary class ...
Francis Cugler's user avatar
1 vote
0 answers
43 views

API for value boxing and unboxing

This is a class representing an exponent. Its main purpose is to deal with logarithmic quantities. ...
user877329's user avatar
1 vote
0 answers
20 views

Wrapping a third party package class to achieve decoupling from the package

I want to create a wrapper around this third party package class so that I don't litter my app with calls to it. The idea being that if there are breaking changes to the package (rename the class or ...
BeniaminoBaggins's user avatar
3 votes
0 answers
95 views

A wrapper library for League Of Legends API

I'm a new Rustacean, decided to make a wrapper for the LeagueOfLegends API. Focus is on simplicity, being able to make any API call with a simple function. I have not finished all functions however it'...
dustytrash's user avatar
  • 2,374
4 votes
1 answer
534 views

C++ wrapper class for array of OpenGL buffer objects -- just the constructors

A similar question was asked here, and I'm trying to do the same thing. But I'm trying a different approach by deriving from std::array, and This is a very focused ...
holomenicus's user avatar
5 votes
0 answers
772 views

safexl - A Python / pywin32 Excel Application wrapper

Thanks in advance for your interest in my first PyPI project. While there happen to be a number of projects out there to help with creating & consuming Excel workbooks, I was unable to find one ...
ThePoetCoder's user avatar
0 votes
1 answer
253 views

Implementation of a vector of pairs

In a personal project I was working on, I had a vector of std::vector< std::pair<unsigned,char>>'s that represented a character and its position in the ...
Jordan's user avatar
  • 79
1 vote
1 answer
757 views

Java wrapper for a movie database API

I am still a beginner and I would love to hear some feedback on a small wrapper I wrote for the TMDb API (https://developers.themoviedb.org/3/getting-started/introduction). It is used for queries on a ...
Karl S.'s user avatar
  • 113
8 votes
1 answer
329 views

WPF BindableProperty<TValue> to Reduce Boiler Plate

I'm sure anyone who has used WPF is familiar with the irritating boilerplate code surrounding properties, usually of this form. ...
HarrisW's user avatar
  • 83
4 votes
1 answer
118 views

Wrapper class for mediainfo

I made the following wrapper for the mediainfo command line. I did this mainly because mediainfo gives me more information than ...
Lewistrick's user avatar
2 votes
1 answer
393 views

Wrap that uses filesystem in C++

This is a wrap that queries the number of files and folder from a given directory, also list the folders and files into a vector. I have posted another wrap in this discussion that do the same things ...
HBatalha's user avatar
  • 345
2 votes
1 answer
115 views

usart driver wrapper

Could you review my usart driver wrapper please? It contains the C language Xilinx usart driver, but I write C++ programs and need to C++ usart driver. How it was designed correctly and what I have ...
Drakonof's user avatar
  • 403
2 votes
1 answer
120 views

REST call helper function returns empty response on timeout errors [closed]

Please review my code where I want to handle the timeout errors and send parsed JSON response if any. There are times when a POST request does not ALWAYS return JSON code. ...
technazi's user avatar
  • 195
2 votes
0 answers
149 views

SharedPreferences singleton wrapper

I was wondering wether my implementation of the PreferenceService below is thread safe or could cause memory leaks. Android Studio gives me the warning "Do not place Android context classes in ...
nullmn's user avatar
  • 121
1 vote
0 answers
232 views

TypeScript Salesforce client library wrapper

I have made a class which wraps the JSForce Salesforce API Client: ...
Gids's user avatar
  • 151
6 votes
2 answers
2k views

Wrapper for Python's argparse class

I'm just trying to learn python: I tend to write my own customized wrappers arround "more complicated" python functionalities so that i can use them more easily, more consistent, easier to change in ...
evilive's user avatar
  • 163
4 votes
2 answers
671 views

Generic wrapper for single value or array of values

I'm writing a chart.js port for c# blazor (you can find it here) using C# 8.0 with .NET Core 3 (latest preview). In chart.js there is this thing called indexable options. It let's you use either a ...
Joelius's user avatar
  • 355
2 votes
0 answers
138 views

Managed Vulkan API Wrapper (create/destroy an instance)

I'm trying to follow this Vulkan API tutorial and have come up with an implementation that I don't completely loathe. The VkUtf8StringArray class is my least ...
Kittoes0124's user avatar
  • 1,940
4 votes
1 answer
287 views

C++ wrapper around uniform mt19937 SequenceContainer [closed]

With the following interface in mind EasyRandom<unsigned int> prng(a, b); auto x = prng(); // scalar auto v = prng(10); // vector I wrote the following ...
Sparkler's user avatar
  • 309
4 votes
2 answers
589 views

F# wrapper to generate SHA256 signature for a file

I've created the following module to allow me to generate a SHA256 signature for a file. (In real life this is used to verify an image file hasn't been amended). The cut down code looks like this: <...
Jackson's user avatar
  • 507
1 vote
1 answer
66 views

Wrapper for LeagueAPI in Node.js

Full code is here: https://github.com/LionelBergen/LeagueReddit I'm creating a wrapper for the LeagueAPI in Node.js. This includes methods to call various endpoints and classes to map the outputs &...
dustytrash's user avatar
  • 2,374
7 votes
2 answers
586 views

Universal OpenGL object RAII wrapper class

I created a universal OpenGL object RAII wrapper class, that only takes care of object creation and destruction. Here's my code and reasoning behind it: I first wrote a class that would take ...
Jacajack's user avatar
  • 225
2 votes
1 answer
35 views

Using deftype to create a wrapper class for byte arrays

I want to create a wrapper class for byte arrays so that I can use them as keys in fastutil's Object2LongAVLTreeMap. I have ...
Martin Harrigan's user avatar
2 votes
0 answers
1k views

Wrapping C++ library in C++/CLI using shared_ptr

Background: I'm writing C++ code after a fairly long time, so I may not be up to date on the best practices, so please bear with me. I'm only trying to improve and learn. Problem I need to write a ...
oczkoisse's user avatar
  • 121
0 votes
1 answer
37 views

A D wrapper around a C function

Any problems with this D wrapper around libcomcom_run_command() C function from C library libcomcom? Does it work as expected? Is it idiomatic? Is it the right way ...
porton's user avatar
  • 101
5 votes
2 answers
366 views

Automatic RAII wrapper for concurrent access

Probably many people had to work with multithreaded applications with C++ and can understand how messy can be fine-grained locking of objects. So once in a while I came to idea of implementing some ...
gudvinr's user avatar
  • 51
1 vote
1 answer
63 views

Wrapping certain elements in an array with an array with PHP

I have a function that's doing this correctly, but I feel as though this can be done (possibly) with minimal code, with recursion, but I'm just wracking my brain. Basically I have JSON that gets ...
Aaron Olin's user avatar
4 votes
0 answers
104 views

Wrapper for Google_Service_Calendar as a Symfony service

My app interacts with Google Calendar. This Service wraps Google_Service_Calendar: ...
Chrisissorry's user avatar
1 vote
1 answer
243 views

Prepare a cross-platform QT C-wrapper class for unit testing and mocking

The situation I recently started a cross platform QT project (arm, linux-x86, windows) that aims to interact with CAN-Bus hardware. I want to learn and get used to unit testing from scratch as good ...
darkmattercoder's user avatar
8 votes
3 answers
384 views

Executable wrapper around Perl script on Windows

I have ack (the searching tool) "installed" as a single file at C:\ack\bin\ack.pl on a Windows 10 machine and was wondering how to make it executable from the ...
Greg Nisbet's user avatar
3 votes
1 answer
101 views

FutureTaskWrapper for Java

I did not like that get synchronizes every time I call it - because I may be calling it more than once. So I wrote the wrapper for the future interface which keeps ...
Audrius's user avatar
  • 33
1 vote
1 answer
125 views

Wrapper for a sales API, with a fluent interface

I've created a simple API wrapper that I intend a few developers to utilize. I decided to follow an Fluent Interface methodology, similar to this. ...
jon.r's user avatar
  • 409
1 vote
2 answers
58 views

Running shell script as root via external binary

I'm not an experienced Linux user and I wanted an easy way to run shell scripts as root from a PHP script, I came up with this: ...
user177906's user avatar
2 votes
2 answers
1k views

Wrapper for a raw array so that it can be passed to templates expecting Standard Library containers

I am working with a code base where unfortunately I cannot replace all raw arrays with std::array. The spec provides no guarantee that the memory layout of a ...
Fibbs's user avatar
  • 195