Single case design pattern, shared data analysis and solution, call_once

Section 7 single case design pattern, shared data analysis, solution, call_once 1. Design mode The program is flexible and easy to maintain. The code written with the concept of design pattern is very obscure, but it will be painful for others to take over and read the codeWhen foreigners deal with particularly large projects, they summariz ...

Posted by big.nerd on Sat, 16 Oct 2021 21:31:28 -0700

Design pattern, policy pattern, c + + implementation

Strategic model, also known as policy model Definition: define a set of algorithms, encapsulate each algorithm and make them interchangeable. The algorithm mentioned here is a function; Encapsulation is to declare virtual functions with base classes, inherit and implement functions with Subclasses; Interchangeability means that the base class ...

Posted by Woolf on Sat, 16 Oct 2021 00:47:40 -0700

C + + learning notes 7

Stream and file I/O operations: Input flow: the flow direction of data is to enter the program; Output stream: the flow direction of data is to leave the program; File I/O: To write data to a file or read data from a file, you need to use ofstream and i fstream in the fsstream library; #include <iostream> #include <fstream> #inclu ...

Posted by dark_destroyer on Fri, 15 Oct 2021 23:55:21 -0700

Single linked list C + + version of data structure

Single linked list C + + version of data structure There is an STL list in C + +. The bottom layer is a two-way linked list. Here, a single linked list is written to play. Included header file #include <iostream> Nothing else. If you want to be more rigorous, add a new header file #include <new> Structure description lin ...

Posted by bhavik_thegame on Fri, 15 Oct 2021 20:54:59 -0700

ROS robot -- little turtle drawing a circle (C + +)

Reference article: (4 messages) ROS robot practice - Little Turtle draws a circle_ Poetry and distant blog - CSDN bloghttps://blog.csdn.net/qq_44907912/article/details/105145132 Reference video: [Gu Yueju] Gu Yue · introduction to ROS 21 lecture | introduction to ROS robot_ Beep beep beep_ bilibilihttps://www.bilibili.com/video/BV1zt41 ...

Posted by gb75 on Fri, 15 Oct 2021 20:01:41 -0700

pygame development: code implementation of Marseille logic game

This article mainly introduces the development of pygame. Through this article, you can use pygame to develop a Marseille logic game ~ friends in need can use it for reference. I hope it can be helpful 1, Game introduction Marseille logic is a logic game similar to Sudoku and minesweeping. It lights up the square according to the data prompts ...

Posted by HockeyDevil07 on Fri, 15 Oct 2021 13:19:36 -0700

UML class diagram relationship and its corresponding code

0. Introduction This blog It's very well written. Most of it is reprinted from this blog in case of forgetting. At the same time, some content is added and expressed in C + +. It's all repeated wheels. It's shameless to mark it as original. Ref01. Generalization, implementation, association, aggregation, composition and dependency in UMLR ...

Posted by hhawkins on Fri, 15 Oct 2021 12:55:50 -0700

[supplementary diary] CF#748 Div.3

Pro Codeforces Round #748 (Div. 3) Sol D2. Half of Same I thought of the positive solution during the game, but it took more space than the positive solution, so I didn't write it out. It's almost the same as D1, but it's not necessarily the smallest one. Therefore, the number of enumerations at each location should be the minimum. Then s ...

Posted by TomNomNom on Fri, 15 Oct 2021 11:36:33 -0700

C++ Function Template and Class Template

0.Summary: Templates are the basis of generic programming, which writes code in a way that is independent of any particular type. Templates are blueprints or formulas for creating generics or functions. Containers, iterators, algorithms, and so on, are examples of generic programming. In C++, templates are divided into function and class tem ...

Posted by surajkandukuri on Fri, 15 Oct 2021 09:16:11 -0700

Basic control of QT software development -- 2.1.6 buttonBox button box

2.1.6 button box   The button box can easily and quickly arrange a group of standard buttons. For example, the common confirmation dialog boxes have standard buttons such as "OK" and "Cancel". Qt makes these typical buttons into standard button boxes and encapsulates the corresponding signals for the convenience of program ...

Posted by V0oD0o on Thu, 14 Oct 2021 11:54:23 -0700