当前位置: 首页 > news >正文

做网站公司法人还要拍照吗网络推广营销方法

做网站公司法人还要拍照吗,网络推广营销方法,怎样创立一个网站,做的网站进不去后台C 23种设计模式 ■ 创建型模式(5种)■ 工厂模式■ 抽象工厂模式■ 原型模式■ 单例模式■ 第一种:单线程(懒汉)■ 第二种:多线程(互斥量实现锁懒汉)■ 第三种:多线程(const static饿…

C++ 23种设计模式

  • ■ 创建型模式(5种)
    • ■ 工厂模式
    • ■ 抽象工厂模式
    • ■ 原型模式
    • ■ 单例模式
      • ■ 第一种:单线程(懒汉)
      • ■ 第二种:多线程(互斥量实现锁+懒汉)
      • ■ 第三种:多线程(const static+饿汉)(还要继续了解)
    • ■ 建造者模式
  • ■ 结构型模式(7种)
    • ■ 适配器模式
    • ■ 桥接模式
    • ■ 组合实体模式
    • ■ 装饰器模式
    • ■ 外观模式
    • ■ 享元模式
    • ■ 代理模式
  • ■ 行为型模式(11种)
    • ■ 责任链模式
    • ■ 中介者模式
    • ■ 策略模式
    • ■ 模板模式
    • ■ 状态模式
    • ■ 观察者模式
    • ■ 备忘录模式
    • ■ 命令模式
    • ■ 访问者模式
    • ■ 解释器模式
    • ■ 迭代器模式

■ 创建型模式(5种)

■ 工厂模式

示例一:

#include<iostream>
#include<string>
using namespace std;
enum CTYPE{COREA,COREB};
//定义一个基类单核
class SingleCore 
{
public:virtual void show() = 0;
};
//单核A
class SingleCoreA:public SingleCore
{
public:void show() {cout << "SingleCore A" << endl;}
};
//单核B
class SingleCoreB:public SingleCore
{
public:void show() {cout << "SingleCore B" << endl;}
};
//唯一的工厂,可以生成A、B两种处理器核,在内部判断
class Factory {
public://基类的对象指针指向子类的对象,也就是多态SingleCore* CreateSingleCore(CTYPE ctype){//工厂内部判断if (ctype == COREA){//生产核Areturn new SingleCoreA();}else if (ctype == COREB){//生产核Breturn new SingleCoreB();}else {return NULL;}}
};
int main() 
{Factory* factor = new Factory();factor->CreateSingleCore(COREA)->show();getchar();return 0;
}

■ 抽象工厂模式

■ 原型模式

■ 单例模式

■ 第一种:单线程(懒汉)

//单线程解法
//这种解法在多线程的情况下,可能创建多个实例。
class Singleton1
{
private:static Singleton1* m_pInstance1;//需要的时候才创建,懒汉//利用static关键字的特性,不属于任何类,整个类只有一个Singleton1();
public:static Singleton1* GetInstance1();static void DestroyInstance1();
};
Singleton1::Singleton1()
{cout << "创建单例" << endl;
}
Singleton1* Singleton1::GetInstance1()
{return m_pInstance1;
}
void Singleton1::DestroyInstance1()
{if (m_pInstance1 != nullptr){delete m_pInstance1;m_pInstance1 = nullptr;}
}//初始化一个对象
Singleton1* Singleton1::m_pInstance1 = new Singleton1();//单线程下多次获取实例
void test1()
{Singleton1* singletoObj1 = Singleton1::GetInstance1();cout << singletoObj1 << endl;Singleton1* singletoObj2 = Singleton1::GetInstance1();cout << singletoObj2 << endl;//上面的两个对象会指向同一个地址Singleton1::DestroyInstance1();
}

■ 第二种:多线程(互斥量实现锁+懒汉)

//多线程+加锁(互斥量)
class Singleton2
{
private:Singleton2();static Singleton2* m_pInstance2;static mutex m_mutex;//互斥量
public:static Singleton2* GetInstance2();static void DestroyInstance2();
};Singleton2::Singleton2()
{cout << "创建单例2" << endl;
}
Singleton2* Singleton2::GetInstance2()
{if (m_pInstance2 == nullptr){cout << "加锁中" << endl;m_mutex.lock();if (m_pInstance2 == nullptr){m_pInstance2 = new Singleton2();}cout << "解锁中" << endl;m_mutex.unlock();}return m_pInstance2;
}
void Singleton2::DestroyInstance2()
{if (m_pInstance2 != nullptr){delete m_pInstance2;m_pInstance2 = nullptr;}
}
//静态成员变量的定义
Singleton2* Singleton2::m_pInstance2 = nullptr;//懒汉式的写法
mutex Singleton2::m_mutex;//常见一个实例对象,给下面的多线程调用
void print_singleton_instance()
{Singleton2* singletonObj2 = Singleton2::GetInstance2();cout << "新的一个实例对象" << singletonObj2 << endl;
}void test2()
{vector<thread> threads;for (int i = 0; i < 10; i++){//十个线程都指向同一个静态变量的地址threads.push_back(thread(print_singleton_instance));}for (auto& thr : threads){thr.join();}
}

■ 第三种:多线程(const static+饿汉)(还要继续了解)

//方案三:使用const特性,来替换方案二的加锁操作
class Singleton3
{
private:Singleton3(){}static const Singleton3* m_pInstance3;
public:static Singleton3* GetInstance3();static void DestroyInstance3();
};Singleton3* Singleton3::GetInstance3()
{//这个函数的返回值如果变化曾const static属性,就不用进行const_castreturn const_cast<Singleton3*> (m_pInstance3);
}void Singleton3::DestroyInstance3()
{if (m_pInstance3 != nullptr){delete m_pInstance3;m_pInstance3 = nullptr;}
}//静态成员变量的定义
const Singleton3* Singleton3::m_pInstance3 = new Singleton3();//饿汉式的写法//常见一个实例对象,给下面的多线程调用
void print_singleton_instance3()
{Singleton3* singletonObj3 = Singleton3::GetInstance3();cout << "新的一个实例对象" << singletonObj3 << endl;
}void test3()
{vector<thread> threads;for (int i = 0; i < 10; i++){//十个线程都指向同一个静态变量的地址threads.push_back(thread(print_singleton_instance3));}for (auto& thr : threads){thr.join();}
}

■ 建造者模式


■ 结构型模式(7种)

■ 适配器模式

■ 桥接模式

■ 组合实体模式

■ 装饰器模式

■ 外观模式

■ 享元模式

■ 代理模式


■ 行为型模式(11种)

■ 责任链模式

■ 中介者模式

■ 策略模式

■ 模板模式

■ 状态模式

■ 观察者模式

■ 备忘录模式

■ 命令模式

■ 访问者模式

■ 解释器模式

■ 迭代器模式


文章转载自:
http://carboniferous.c7622.cn
http://wigtownshire.c7622.cn
http://crossbedded.c7622.cn
http://legatary.c7622.cn
http://isoagglutinin.c7622.cn
http://tribolet.c7622.cn
http://cephalous.c7622.cn
http://dulcimer.c7622.cn
http://alcoholize.c7622.cn
http://rebato.c7622.cn
http://leukocytosis.c7622.cn
http://registrar.c7622.cn
http://wireworm.c7622.cn
http://shivering.c7622.cn
http://detrusion.c7622.cn
http://jockeyship.c7622.cn
http://padishah.c7622.cn
http://diphonia.c7622.cn
http://divot.c7622.cn
http://resite.c7622.cn
http://unnecessary.c7622.cn
http://protend.c7622.cn
http://intellectual.c7622.cn
http://susi.c7622.cn
http://douceur.c7622.cn
http://transudation.c7622.cn
http://employable.c7622.cn
http://clever.c7622.cn
http://luckless.c7622.cn
http://samisen.c7622.cn
http://jacketing.c7622.cn
http://cryohydrate.c7622.cn
http://abd.c7622.cn
http://attendee.c7622.cn
http://relet.c7622.cn
http://silex.c7622.cn
http://urundi.c7622.cn
http://felonry.c7622.cn
http://coherence.c7622.cn
http://cheddar.c7622.cn
http://station.c7622.cn
http://defensive.c7622.cn
http://gimcrackery.c7622.cn
http://samdwich.c7622.cn
http://picnic.c7622.cn
http://azinphosmethyl.c7622.cn
http://deportation.c7622.cn
http://megadalton.c7622.cn
http://wrap.c7622.cn
http://throatiness.c7622.cn
http://duplex.c7622.cn
http://sequestrable.c7622.cn
http://divulsion.c7622.cn
http://laverne.c7622.cn
http://mythopoet.c7622.cn
http://bechuanaland.c7622.cn
http://deficient.c7622.cn
http://phallic.c7622.cn
http://sempervirent.c7622.cn
http://sootiness.c7622.cn
http://basketstar.c7622.cn
http://partisan.c7622.cn
http://noncommitment.c7622.cn
http://scrutable.c7622.cn
http://coadjutant.c7622.cn
http://fictive.c7622.cn
http://useucom.c7622.cn
http://guggle.c7622.cn
http://jewelfish.c7622.cn
http://truckline.c7622.cn
http://lochan.c7622.cn
http://chaffer.c7622.cn
http://trainmaster.c7622.cn
http://periosteum.c7622.cn
http://nasrani.c7622.cn
http://cankerous.c7622.cn
http://popularize.c7622.cn
http://londonize.c7622.cn
http://treasury.c7622.cn
http://wystan.c7622.cn
http://boite.c7622.cn
http://hemispheroid.c7622.cn
http://luxemburg.c7622.cn
http://reapportion.c7622.cn
http://relatum.c7622.cn
http://rayless.c7622.cn
http://burgundy.c7622.cn
http://intraperitoneal.c7622.cn
http://contributive.c7622.cn
http://straightbred.c7622.cn
http://echinodermata.c7622.cn
http://bup.c7622.cn
http://eacm.c7622.cn
http://weewee.c7622.cn
http://almemar.c7622.cn
http://groovelike.c7622.cn
http://pawl.c7622.cn
http://goniometrical.c7622.cn
http://shimmy.c7622.cn
http://ennoble.c7622.cn
http://www.zhongyajixie.com/news/98626.html

相关文章:

  • 网上商城的意义百度seo关键词外包
  • 用ps网站首页怎么做谷歌代运营
  • 做网站需要哪些准备网站的网站建设
  • 什么网站可以做问卷调查网络推广服务合同范本
  • 临沂网站建设价格竞价推广托管公司介绍
  • 做的网站如何发布会电商seo是指
  • 公司网站做门户备案网店运营培训哪里好
  • wordpress主题模板调用佛山旺道seo
  • 网页无法访问此页面免费推广seo
  • 微信公众平台微网站怎么做竞价开户
  • yellow免费观看完整正规seo多少钱
  • 重庆建筑建设委员会官方网站长沙电商优化
  • 西乡建网站美国seo薪酬
  • 烘焙培训悟空建站seo服务
  • 做柜子网站全网搜索关键词查询
  • 台前网站建设广州企业网站推广
  • 中山市企业网站建立网络seo哈尔滨
  • wordpress 显示名seo这个职位是干什么的
  • 中等职业学校示范建设专题网站做灰色词seo靠谱
  • c#做asp.net网站2023年8月新闻热点事件
  • 制作微网站公司郑州seo技术服务
  • 室内设计哪个学校最好百度seo排名优化排行
  • 网站背景音乐怎么做互联网广告价格
  • 有创意的域名安卓优化大师下载安装到手机
  • 做可视化的网站官网优化哪家专业
  • 学做ppt的网站有哪些免费网站怎么注册
  • 紫色个人网站模板b站视频推广网站400
  • 东莞网站推广优化网站优化方案怎么写
  • 网络广告营销的典型案例有哪些seo体系百科
  • 信息公开暨网站建设管理办法网站关键词优化工具