- 博客(85)
- 资源 (17)
- 收藏
- 关注
原创 C++设计模式-创建型-简单工厂模式,工厂方法模式,抽象工厂模式,附builder、singleton、prototype
抽象工厂模式:创建二维对象,即一个工厂创建多个产品。形成一个表格,例如型号a,b,c和系列1,2,3对应产品可以有a1,a2,a3,b1,b2,b3,c1...等。singleton:全局有且仅需要有一个对象且都要用。(问这种模式的往往项目不使用设计模式与uml)。工厂方法模式:创建一维对象,即一个工厂创建一个产品。builder模式:根据xml解析为内存对象。简单工厂模式:根据字符串参数返回对象。
2024-02-04 22:37:05 993
原创 C++设计模式-依赖倒置原则
定义:高层不依赖底层,两者依赖抽象;依赖传递方法:1.构造函数2.set函数3.直接调用法。依赖倒置原则定义了类的。(封装、继承、多态)
2024-02-03 21:01:30 88
原创 希望有能力的人可以出一本《Qt源码剖析》
从Qt源代码实现,概念、原理及应用、Qt底层库架构设计、注意事项等角度讲解,各行各业Qt程序员软件质量会整体大幅度提升。希望有能力的人协调一下可以出一本《Qt源码剖析》。现在各行各业Qt程序员都在缺这方面的知识和书。
2023-11-07 21:48:41 101
原创 QEventLoop概念原理及应用
分享一篇技术文章,从概念原理及应用分析QEventLoop问题,其他qt工程师遇到此类问题可以快速解决、提高软件质量。
2023-11-04 13:05:20 1094
原创 std::string_view概念原理及应用
使用const string&作为参数是先使用字符串字面量编译器会创建一个临时字符串对象然后创建std::string。或者一个函数提供char*和const string&参数的两个版本函数,不是优雅的解决方案。于是需要一个只使用内存不维护内存的类。
2023-10-21 17:11:45 182
原创 统一git使用方法,git状态变迁图,git commit提交规范
要在本地合并代码再提交到远程;自行查资料学习git并使用,会出现使用各种偏僻的命令,异常问题无法解决;参考 https://blog.csdn.net/zhgeliang/article/details/81110179。git设置 mergetool为kdiff3//解决冲突使用kdiff3软件。git commit --amend -m "实际修改注释"提交本地master分支到远程master分支。把远程下载的代码合并到远程master分支。对比本地修改与git节点的差别。修改git文件和节点描述。
2023-08-21 23:31:05 527
原创 c++ std::shared_ptr的线程安全问题(race condition)
race condition下,引用计数混乱,错误未知,造成wild pointer/memory leak/crash。有 3 个 shared_ptr 对象 x、g、n;
2023-08-16 16:43:57 277
原创 c++ std::shared_ptr(内存布局)
https://cplusplus.com/reference/memory/shared_ptr/
2023-08-16 15:13:34 171
原创 c++虚继承(使用)
1.构造顺序按派生列表顺序,若有虚基类先构造虚基类,销毁顺序和构造顺序相反。2.虚基类时,孙子C来初始化爷爷Grand。附:thinking in c++ 2nd。
2023-08-14 18:22:30 149
原创 vs2019+vtk开发环境搭建
1.为什么不使用vs2022?vs2022不支持扩展-管理扩展方式安装visual assist x;vs2022编辑代码时visual assist x不能自动生成代码。先点一次configure初始化之后,选中VTK_BUILD_EXAMPLES再点一次configure;就这样,你看到这篇日志节省一点开发环境搭建时间,过低版本其他生态需要的开源库也必须是低版本甚至无法使用,追求高版本浪费时间不容易搭建。1.安装vs2019 Enterprise,visual assist x,cmake。
2023-04-29 22:54:46 1239
原创 vtk写点vtk文件,只有几何Geometry,没有拓扑Topology
【代码】vtk写点vtk文件,只有几何Geometry,没有拓扑Topology。
2023-04-12 21:39:23 105
原创 vs2015+vtk开发环境搭建
问题:1.为什么不使用vs2022?vs2022支持的visual assist x不好用,vs2022编辑代码时visual assist x不能自动生成代码。2.为什么不用最高版本vtk9.2.6?因为高版本vtk库使用更高c++特性,vs2015无法编译通过。1.安装vs2015 Enterprise,visual assist x,cmake。3.cmake编译配置选中Example,可编译官方例子。就这样,你看到这篇日志节省一点开发环境搭建时间。
2023-04-05 23:05:15 324
原创 时序图
用类图生成代码,从代码生成类图时序图:visio,staruml状态图:用于编代码活动图:流程图带泳道的活动图:分组的活动图双泳道的活动图
2015-12-25 18:44:21 509
原创 swift2.0 - study
//// main.swift// mycmd//// Created by zhaoxuhui on 15/10/27.// Copyright © 2015年 zhaoxuhui. All rights reserved.//import Foundationvar str = "Hello, pl
2015-11-05 22:59:44 592
翻译 swift - The command pattern
The command pattern provides a mechanism by which details of how to invoke a method can beencapsulated so that the method can be invoked later or by a different component. 命令模式:把每一次执行的命令放到一个队
2015-09-01 23:41:24 415
翻译 swift - The Chain Responsibility pattern
The chain of responsibility pattern is useful when there are multiple objects that could takeresponsibility for a request but you don’t want to expose details of those objects to the callingcomponent.
2015-08-31 23:40:31 390
翻译 swift - The Proxy Pattern
I describe the proxy pattern in this chapter, which is used when an object is required to act as an interface to another object or resource. There are three main ways in which the proxy pattern is a
2015-08-28 23:51:27 401
翻译 swift - The Flyweight Pattern
The flyweight pattern is applied when a number of similar objects all rely on the same set of datavalues. Rather than create a new set of data valued for each of the objects, the flyweight patternsh
2015-08-27 23:33:30 385
翻译 swift - The Facade Pattern
Facade(外观)模式为子系统中的各类(或结构与方法)提供一个简明一致的界面,隐藏子系统的复杂性,使子系统更加容易使用。它是为子系统中的一组接口所提供的一个一致的界面。client:import Foundation;let facade =PirateFacade();let prize = facade.getTreasur
2015-08-25 23:20:47 311
翻译 swift - The Composite Pattern
It shows you how the composite pattern can be used so that different kinds of objects in a tree data structure can be treated consistently. 复合模式:这个设计模式为你展示了不同类型的在树中的数据结构如何一致的对待。
2015-08-12 22:48:11 349
翻译 swift - The Decorator Pattern
装饰者模式:多个类派生于一个基础类,这几个类可以嵌套构造来装饰。client:let account =CustomerAccount(name:"Joe");account.addPurchase(Purchase(product:"Red Hat", price: 10));account.addPurchase(Purchase(product:
2015-08-12 22:08:17 393
鸟哥的Linux(第三版).pdf
2010-12-09
Macraigor.Systems.Flash.Programmer.v3.0.7 with .Incl.Keygen-EDGE.rar
2010-12-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人