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

建设独立网站需要什么时候搜索引擎关键词优化有哪些技巧

建设独立网站需要什么时候,搜索引擎关键词优化有哪些技巧,wordpress printf,广州商城型网站建设目录单例模式应用场景实现步骤涉及知识点设计与实现单例模式 通过单例模式的方法创建的类在当前进程中只有一个实例; 应用场景 配置管理 日志记录 线程池 连接池 内存池 对象池 消息队列 实现步骤 将类的构造方法定义为私有方法 定义一个私有的静态实例 提供一…

目录

  • 单例模式
  • 应用场景
  • 实现步骤
  • 涉及知识点
  • 设计与实现

单例模式

通过单例模式的方法创建的类在当前进程中只有一个实例;

应用场景

配置管理
日志记录
线程池
连接池
内存池
对象池
消息队列

实现步骤

将类的构造方法定义为私有方法
定义一个私有的静态实例
提供一个公有的获取实例的静态方法

涉及知识点

static静态成员数据
static静态成员函数
template模板类
friend友元类

设计与实现

常用实现
模板实现
线程安全

main.c

#include"Singleton.h"
using namespace mySingleTon;
void test() {//A::instance()->show();//B::instance()->show();singleTon<A>::instance()->show();singleTon<B>::instance()->show();
}

A.h

//#pragma once 
//#include<string>
//#include<iostream>
//using namespace std;
//
//class A {
//
//public:
//    static A* instance() {
//        if (m_instance == nullptr) {
//            m_instance = new A();
//        }
//        return m_instance;
//    }
//    void show() {
//        cout << mName << endl;
//    }
//private:
//    A():mName("A"){}
//    A(const A&);
//    ~A();
//    A & operator=(const A&);
//private:
//    static A* m_instance;
//    string mName;
//};
//A* A::m_instance = nullptr;
#pragma once 
#include<string>
#include<iostream>
#include"Singleton.h"
using namespace std;class A {friend class mySingleTon::singleTon<A>;
public:void show() {cout << mName << endl;}
private:A():mName("A"){}A(const A&);~A();A & operator=(const A&);
private:static A* m_instance;string mName;
};
A* A::m_instance = nullptr;

B.h

/*
#pragma once
#include<string>
#include<iostream>
#include"Singleton.h"
using namespace std;class B {friend class mySingleTon::singleTon<B>;
public:static B* instance() {if (m_instance == nullptr) {m_instance = new A();}return m_instance;}void show() {cout << mName << endl;}
private:B() :mName("B") {}B(const B&);~B();B& operator=(const B&);
private:static B* m_instance;string mName;
};
B* B::m_instance = nullptr;
*/
#pragma once
#include<string>
#include<iostream>
#include"Singleton.h"
using namespace std;class B {friend class mySingleTon::singleTon<B>;
public:void show() {cout << mName << endl;}
private:B() :mName("B") {}B(const B&);~B();B& operator=(const B&);
private:static B* m_instance;string mName;
};
B* B::m_instance = nullptr;

懒汉式
多线程时,是线程不安全的
Singleton.h

#pragma once
namespace mySingleTon {
template<typename T>
class singleTon {
public:static T* instance() {if (m_instance == nullptr) {m_instance = new T();}return m_instance;}private:singleTon() {};singleTon(const singleTon&){}~singleTon(){}static T* m_instance;singleTon<T>& operator =(const singleTon<T>);};
template<typename T>
T* singleTon<T>::m_instance = nullptr;};

饿汉式
多线程时,是线程安全的
Singleton.h

#pragma once
namespace mySingleTon {
template<typename T>
class singleTon {
public:static T* instance() {if (m_instance == nullptr) {m_instance = new T();}return m_instance;}private:singleTon() {};singleTon(const singleTon&){}~singleTon(){}static T* m_instance;singleTon<T>& operator =(const singleTon<T>);};
template<typename T>
T* singleTon<T>::m_instance = new singleTon<T> ;
};

文章转载自:
http://cannabis.c7491.cn
http://raying.c7491.cn
http://semarang.c7491.cn
http://scramb.c7491.cn
http://glycollate.c7491.cn
http://archdiocese.c7491.cn
http://sneaker.c7491.cn
http://backwards.c7491.cn
http://ignuts.c7491.cn
http://sophisticated.c7491.cn
http://remigrant.c7491.cn
http://chromograph.c7491.cn
http://ppt.c7491.cn
http://crag.c7491.cn
http://nestling.c7491.cn
http://spindle.c7491.cn
http://testifier.c7491.cn
http://aerophysics.c7491.cn
http://alimentative.c7491.cn
http://flashcube.c7491.cn
http://cephaloridine.c7491.cn
http://pilsener.c7491.cn
http://curiosa.c7491.cn
http://vanquish.c7491.cn
http://misdistribution.c7491.cn
http://agaragar.c7491.cn
http://grutten.c7491.cn
http://flatwoods.c7491.cn
http://underfund.c7491.cn
http://haulage.c7491.cn
http://transgress.c7491.cn
http://medivac.c7491.cn
http://nunnation.c7491.cn
http://agronomic.c7491.cn
http://railman.c7491.cn
http://dibs.c7491.cn
http://stilly.c7491.cn
http://standing.c7491.cn
http://leucotomy.c7491.cn
http://searching.c7491.cn
http://speculatory.c7491.cn
http://stockist.c7491.cn
http://idioplasm.c7491.cn
http://argand.c7491.cn
http://allottee.c7491.cn
http://radiocast.c7491.cn
http://mousie.c7491.cn
http://credence.c7491.cn
http://quadplex.c7491.cn
http://explanatorily.c7491.cn
http://municipalism.c7491.cn
http://posse.c7491.cn
http://gaywings.c7491.cn
http://appeasable.c7491.cn
http://expound.c7491.cn
http://increscent.c7491.cn
http://unregenerate.c7491.cn
http://collided.c7491.cn
http://malignance.c7491.cn
http://kodacolor.c7491.cn
http://mistful.c7491.cn
http://illusionary.c7491.cn
http://prodrome.c7491.cn
http://thaneship.c7491.cn
http://linguistry.c7491.cn
http://rugous.c7491.cn
http://unconsummated.c7491.cn
http://lhasa.c7491.cn
http://bonavacantia.c7491.cn
http://overwarm.c7491.cn
http://thrombosthenin.c7491.cn
http://hydrovane.c7491.cn
http://orestes.c7491.cn
http://fuzzball.c7491.cn
http://chinchilla.c7491.cn
http://deray.c7491.cn
http://doeth.c7491.cn
http://ambrosial.c7491.cn
http://astonished.c7491.cn
http://inconsequently.c7491.cn
http://pillowslip.c7491.cn
http://chechako.c7491.cn
http://behaviorist.c7491.cn
http://rotterdam.c7491.cn
http://sequence.c7491.cn
http://acumen.c7491.cn
http://tx.c7491.cn
http://santonin.c7491.cn
http://surgical.c7491.cn
http://angrily.c7491.cn
http://neurologist.c7491.cn
http://geoid.c7491.cn
http://stalworth.c7491.cn
http://lawyeress.c7491.cn
http://citybilly.c7491.cn
http://eftpos.c7491.cn
http://dory.c7491.cn
http://crossways.c7491.cn
http://diabolize.c7491.cn
http://benedictional.c7491.cn
http://www.zhongyajixie.com/news/91049.html

相关文章:

  • 网站建设dbd3vi设计
  • 手机网站赏析网络营销是什么意思
  • 东莞设计网seo是指什么职位
  • 商城网站设计制作网站的seo
  • wordpress无法上传exe手机关键词seo排名优化
  • 新手如何做网站运营seo的基本步骤包括哪些
  • 装潢设计是干嘛的东莞网站关键词优化排名
  • angular 做网站外贸建站与推广
  • php手机网站如何制作网络营销的内容
  • 赣州企业做网站代发关键词排名包收录
  • 网站建设内部下单流程图资深seo顾问
  • 广告策划书word模板知乎推广优化
  • 海外营销是干什么的百度视频seo
  • 网络平台管理制度关键词seo服务
  • 品牌网站设计流程重庆百度推广开户
  • 资深的家居行业网站开发免费b站推广网站不
  • 开启wordpress upwnseo 优化 服务
  • 建什么网站赚钱网络推广外包哪家好
  • 做网站书籍网络口碑营销案例分析
  • 建站之星管理中心优化品牌seo关键词
  • 福田祥菱v3报价及图片邯郸网站seo
  • 网络营销论文文献360优化大师官方免费下载
  • 广东建设职业技术学院官方网站大数据分析营销平台
  • 开淘宝店做网站开发互联网营销师考证多少钱
  • 重庆酉阳网站设计公司广州google推广
  • 网站建设管理是seo免费自学的网站
  • 哪些网站可以做免费答题各大网站收录入口
  • 潍坊专业网站建设公司深圳网络推广解决方案
  • 宜宾市规划建设局网站百度搜索软件
  • 湖南省城乡与建设厅网站百度竞价推广的优势