代码搜索:singleton
找到约 4,696 项符合「singleton」的源代码
代码结果 4,696
www.eeworm.com/read/124619/6044023
java singleton.java
public class Singleton
{
private static Singleton theInstance = null;
private Singleton() {}
public static Singleton Instance()
{
if (theInstance == null)
theInstance = new Singleto
www.eeworm.com/read/185436/6297456
cpp singleton.cpp
////////////////////////////////////////////////////////////////////////////////
// The Loki Library
// Copyright (c) 2001 by Andrei Alexandrescu
// This code accompanies the book:
// Alexandrescu
www.eeworm.com/read/185436/6297473
h singleton.h
////////////////////////////////////////////////////////////////////////////////
// The Loki Library
// Copyright (c) 2001 by Andrei Alexandrescu
// This code accompanies the book:
// Alexandrescu
www.eeworm.com/read/489997/6465306
java singleton.java
public class Singleton {
private Singleton(){}
//在自己内部定义自己一个实例
//注意这是private 只供内部调用
private static Singleton instance = new Singleton();
//这里提供了一个供外部访问本class的静态方法,可以直接访问
publ
www.eeworm.com/read/479983/6674323
cpp singleton.cpp
/********************************************************************
created: 2006/07/20
filename: Singleton.cpp
author: 李创
http://www.cppblog.com/converse/
purpose: Sing
www.eeworm.com/read/479983/6674325
h singleton.h
/********************************************************************
created: 2006/07/20
filename: Singleton.h
author: 李创
http://www.cppblog.com/converse/
purpose: Single
www.eeworm.com/read/408073/11405902
h singleton.h
#pragma once
// FIXME: Should create the instance on first use!
template class Singleton
{
public:
static T& Instance()
{
static T theSingleInstance;
www.eeworm.com/read/403321/11519143
gif singleton.gif
www.eeworm.com/read/403014/11523780
cpp singleton.cpp
//: C10:Singleton.cpp
// From Thinking in C++, 2nd Edition
// Available at http://www.BruceEckel.com
// (c) Bruce Eckel 2000
// Copyright notice in Copyright.txt
// Static member of same type, en