- 博客(14)
- 资源 (9)
- 收藏
- 关注
转载 设计模式
Factory method pattern工厂方法模式 是一种面向对象的设计模式。通过调用不同的方法返回需要的类,而不是去实例化具体的类。 对实例创建进行了包装。 工厂方法是一组方法, 他们针对不同条件返回不同的类实例,这些类一般有共同的父类。工厂方法模式实施一种按需分配的策略, 即传入参数进行选择, 工厂方法根据参数进行选择,返回具体的实例。#include #include #include class Pizza {public: virtual int getPri
2010-09-04 13:42:00
378
转载 ThreadPool
<br />原文地址:<br />http://www.codeproject.com/KB/threads/win32threadpool.aspx<br /> <br />#ifndef THREAD_POOL_CLASS#define THREAD_POOL_CLASS#pragma warning( disable : 4786) // remove irritating STL warnings#include <windows.h>#include <list>#incl
2010-09-04 13:33:00
756
转载 Microsoft Visual Studio cstring
<br />/****memcpy - Copy source buffer to destination buffer**Purpose:* memcpy() copies a source memory buffer to a destination memory buffer.* This routine does NOT recognize overlapping buffers, and thus can lead* to propoga
2010-08-10 10:52:00
924
转载 glBlendFunc 参数详解
<br />http://hi.baidu.com/devisdu/blog<br /> <br />OpenGL 会把源颜色和目标颜色各自取出,并乘以一个系数(源颜色乘以的系数称为“源因子”,目标颜色乘以的系数称为“目标因子”),然后相加,这样就得到了新的颜 色。(也可以不是相加,新版本的OpenGL可以设置运算方式,包括加、减、取两者中较大的、取两者中较小的、逻辑运算等,但我们这里为了简单起见,不讨 论这个了)<br />下面用数学公式来表达一下这个运算方式。假设源颜色的四个分量(指红色,绿色,蓝色,a
2010-08-03 16:33:00
2507
原创 SDL&Opengl
<br />bool DrawImage(string name, CRectangle rect, float zDepth){ glEnable( GL_TEXTURE_2D ); glEnable(GL_BLEND); glDisable(GL_DEPTH_TEST); GLuint texture; // Texture object handle SDL_Surface *surface; // Gives us the information to mak
2010-07-24 21:55:00
1495
1
转载 opengl glut 下载地址
<br />opengl2<br />http://tclab.kaist.ac.kr/~cs580/FTP/OPENGL/sgi-license.html<br /> <br /> <br />glut<br />http://www.xmission.com/~nate/glut.html
2010-07-22 13:25:00
1462
转载 C++ 虚函数
<br /> <br />转载地址:http://www.cppblog.com/xczhang/archive/2008/01/20/41508.html<br /> <br />C++中的虚函数的作用主要是实现了多态的机制。关于多态,简而言之就是用父类型别的指针指向其子类的实例,然后通过父类的指针调用实际子类的成员函数。这种技术可以让父类的指针有“多种形态”,这是一种泛型技术。所谓泛型技术,说白了就是试图使用不变的代码来实现可变的算法。比如:模板技术,RTTI技术,虚函数技术,要么是试图做到在编译时决议
2010-07-22 11:09:00
385
转载 VS2005 什么折叠代码
<br />(中文版)工具--选项--文本编辑器--C/C++--格式设置--语句块自动大纲显示<br />(英文版)Tools---Options---Text Editor----c/c++---Formatting<br /> 把对应项勾上 <br /> <br /> <br />http://topic.youkuaiyun.com/u/20090624/17/c96b46c7-fa08-4459-85ab-47657bbc776a.html<br />
2010-06-17 22:20:00
1836
转载 Effective STL(摘录-01)
在另一个场景里,这不再是风格问题。为了避免潜在的解析含糊(我将提供给你细节),你被要求在依赖形式类型参数的类型名字之前使用typename。这样的类型被称为依赖类型,一个例子将帮助阐明我所说的。假设你想为函数写一个模板,给定一个STL容器,返回容器中的最后一个元素是否大于第一个元素。这是一种方法:templatebool lastGreaterThanFirst(const C& container){ if (container.empty()) return false; t
2010-06-10 11:53:00
465
原创 KMP算法
#include "stdafx.h"#include #include #include #include using namespace std;//KMPvoid NextIndex(const char array[], int len, int next[]){ next[0] = -1; next[1] = 0; for
2010-05-13 10:07:00
287
原创 Linux下获取MAC地址
#include #include #include #include #include #include #include #include #include #includeint main(int argc, char **argv){ printf("helloworld/n"); int nSocket;
2010-05-12 16:17:00
445
原创 API查询网址
linux api reference http://www.qnx.com/developers/docs/6.4.1/neutrino/lib_ref/lib-a.html http://www.mkssoftware.com/docs/api_index.asp socket api reference http://support.sas.
2010-04-29 12:33:00
676
原创 linux线程的挂起与恢复
#include #include #include #include pthread_mutex_t wqy_mutex_pause = PTHREAD_MUTEX_INITIALIZER;pthread_cond_t wqy_cond_pause = PTHREAD_COND_INITIALIZER;bool wqy_pthread_pause = false;
2010-04-16 09:02:00
7408
2
原创 队列的实现
template class Queue{public: Queue() { m_head = 0; m_rear = 0; m_rear = 0; } explicit Queue(const Queue& other); Queue& operator =(const Queue& other); ~Queue() {
2010-03-22 15:37:00
549
SDL是Simple DirectMedia Layer(简易直控媒体层)
2010-05-04
windows下的opengl2 glut
2010-07-22
检查当前文件夹及其子文件夹PNG,BMP文件格式是否符合2的N次幂
2010-03-20
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人