会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
于光远
博客园
首页
新随笔
联系
订阅
管理
2025年12月15日
linux 内核
摘要: 操作系统10个模块: 1. 进程管理: 负责创建、调度、同步、通信和终止进程或者线程 2. 内存模块:负责分配和管理内存资源(虚拟内存和物理内存的管理) 3. 文件系统:负责文件的存储、组织、检索和管理 4. 设备驱动:负责管理各种硬件设备(输入输出设备、存储设备) 5.网络通信:提供网络接口和通信
阅读全文
posted @ 2025-12-15 13:27 于光远
阅读(1)
评论(0)
推荐(0)
2025年11月10日
策略模式
摘要: 策略模式(Strategy Pattern)是一种行为型设计模式,其核心思想是定义一组算法,将每个算法封装为独立的类,使它们可以互相替换12。该模式通过将算法与使用它的客户端解耦,实现运行时动态切换算法,避免使用多重条件判断语句(如if-else) 核心特点 算法封装:每个算法被封装为独立的策略类,
阅读全文
posted @ 2025-11-10 09:16 于光远
阅读(7)
评论(0)
推荐(0)
单例模式
摘要: 单例模式,指的是,在一些特定的场景当中,某一些类只能创建出一个实例(对象)。无论是单线程还是多线程环境下面,都只能生成一个对象,这个时候,就需要使用到单例模式。 主要是为了防止一个类实例化多个对象造成数据不一致问题或者造成资源消耗问题(构建过程中的时间消耗、内存消耗) 怎么设置单例模式 私有化构造函
阅读全文
posted @ 2025-11-10 09:14 于光远
阅读(9)
评论(0)
推荐(0)
2024年5月7日
引用
摘要: 左值 右值 (纯右值,将亡值) 可以在等号左边 只能在等号右边 能够取到地址 不能取地址 具名 不具名 1. 变量名 2.返回左值引用的函数 3.解引用 (*this) 4. ++i是左值 5. 声明出来的左值引用 6.右值引用 1.返回非引用类型的函数调用 (int func(void)) 2.i
阅读全文
posted @ 2024-05-07 13:30 于光远
阅读(56)
评论(0)
推荐(0)
2022年8月3日
linux 脚本打印时间
摘要: #!/bin/bash now=$(/bin/date +%y%m%d%H%M%S%N) echo $now $line
阅读全文
posted @ 2022-08-03 14:12 于光远
阅读(97)
评论(0)
推荐(0)
2022年7月14日
接口编程
摘要: App调用接口,依赖头文件和库。 库文件更新,App代码不需要重新编译,直接就可以运行。 //main.cpp //main.cpp #include "IStudent.h" int main(){ getIStudent()->TellStory(); } //IStudent.h//#prag
阅读全文
posted @ 2022-07-14 20:21 于光远
阅读(130)
评论(0)
推荐(0)
2022年7月13日
不定参数解析,结合tuple
摘要: #include <iostream> #include <tuple> using namespace std; template<class... Args> class student{ public: template<typename HEAD> void displayParam(con
阅读全文
posted @ 2022-07-13 18:23 于光远
阅读(59)
评论(0)
推荐(0)
2022年3月10日
独立于main运行的程序
摘要: #include <iostream> using namespace std; #define INITIALIZER(f) \ static void f(void) __attribute__((constructor)); \ static void f(void) #define DEIN
阅读全文
posted @ 2022-03-10 18:56 于光远
阅读(55)
评论(0)
推荐(0)
类模板继承
摘要: #include <iostream> using namespace std; class interface{ public: virtual int getAge()=0; virtual int getAge1()=0; }; class person:virtual public inte
阅读全文
posted @ 2022-03-10 15:58 于光远
阅读(91)
评论(0)
推荐(0)
std::ostream & operator<<
摘要: #include <iostream> #include <iostream> #include <string> class test{ public: test(const std::string _domain,const std::string _interface,const std::s
阅读全文
posted @ 2022-03-10 14:26 于光远
阅读(669)
评论(0)
推荐(0)
下一页
公告