锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲日本乱码在线观看,国产精品影片在线观看,国产一区二区久久http://www.shnenglu.com/yehao/category/16561.htmlzh-cnFri, 06 May 2011 16:36:33 GMTFri, 06 May 2011 16:36:33 GMT60瑙傚療鑰呮ā寮?璁捐妯″紡http://www.shnenglu.com/yehao/articles/145337.html鍘氱Н钖勫彂鍘氱Н钖勫彂Fri, 29 Apr 2011 08:59:00 GMThttp://www.shnenglu.com/yehao/articles/145337.htmlhttp://www.shnenglu.com/yehao/comments/145337.htmlhttp://www.shnenglu.com/yehao/articles/145337.html#Feedback0http://www.shnenglu.com/yehao/comments/commentRss/145337.htmlhttp://www.shnenglu.com/yehao/services/trackbacks/145337.htmlhttp://www.shnenglu.com/unixfy/archive/2011/04/26/145077.html

Part of the red marker to add by YeHao錛孫rder oneself to better understand.

瑙傚療鑰呮ā寮?璁捐妯″紡

鏉ヨ嚜浜庛婂ぇ璇濊璁℃ā寮忋?br>瑙傚療鑰呮ā寮忥細瀹氫箟浜嗕竴縐嶄竴瀵瑰鐨勪緷璧栧叧緋伙紝璁╁涓瀵熻呭璞″悓鏃剁洃鍚煇涓涓富棰樺璞°傝繖涓富棰樺璞″湪鐘舵佸彂鐢熸椂錛屼細閫氱煡鎵鏈夎瀵熻呭璞★紝浣夸粬浠嚜鍔ㄦ洿鏂拌嚜宸便?br>
琛屼負鍨嬫ā寮忋?br>
UML 綾誨浘錛?br>
浠g爜瀹炵幇 C++錛?br>
  1 #include <iostream>
  2 #include <string>
  3 #include <list>
  4 #include <algorithm>
  5 using namespace std;
  6 
  7 class Subject;
  8 
  9 class Observer   //瑙傚療鑰?/span>
 10 {
 11 protected:
 12     string name;
 13     Subject* sub;
 14 public:
 15     Observer(const string& n, Subject* s) : name(n), sub(s) {}
 16     virtual void Update() = 0;
 17 };
 18 
 19 class Subject   //琚瀵熻?br> 20 {
 21 protected:
 22     list<Observer*> observers;
 23     string action;
 24 public:
 25     virtual void Attach(Observer* ob) = 0;   //澧炲姞瑙傚療鑰呭璞?br> 26     virtual void Detach(Observer* ob) = 0;   //縐婚櫎瑙傚療鑰呭璞?br> 27     virtual void Notify() = 0;
 28     virtual void setAction(const string& s) = 0;
 29     virtual string getAction() = 0;
 30 };
 31 
 32 class StockObserver : public Observer
 33 {
 34 public:
 35     StockObserver(const string& name, Subject* s) : Observer(name, s) {}
 36     virtual void Update()
 37     {
 38         cout << sub->getAction() << '\t' << name << " 鍏抽棴鑲$エ琛屾儏錛岀戶緇伐浣滐紒" << endl;
 39     }
 40 };
 41 
 42 class NBAObserver : public Observer
 43 {
 44 public:
 45     NBAObserver(const string& name, Subject* s) : Observer(name, s) {}
 46     virtual void Update()
 47     {
 48         cout << sub->getAction() << '\t' << name << " 鍏抽棴 NBA錛岀戶緇伐浣滐紒" << endl;
 49     }
 50 };
 51 
 52 class Boss : public Subject
 53 {
 54 //private:
 55 //    list<Observer*> observers;
 56 //    string action;
 57 public:
 58     virtual void Attach(Observer* ob)
 59     {
 60         observers.push_back(ob);
 61     }
 62     virtual void Detach(Observer* ob)
 63     {
 64         list<Observer*>::iterator iter= find(observers.begin(), observers.end(), ob);
 65         if (iter != observers.end())
 66         {
 67             observers.erase(iter);
 68         }
 69     }
 70     virtual void Notify()
 71     {
 72         for (list<Observer*>::iterator iter = observers.begin(); iter != observers.end(); ++iter)
 73         {
 74             (*iter)->Update();
 75         }
 76     }
 77     virtual void setAction(const string& s)
 78     {
 79         action = s;
 80     }
 81     virtual string getAction()
 82     {
 83         return action;
 84     }
 85 };
 86 
 87 class Secretary : public Subject
 88 {
 89 //private:
 90 //    list<Observer*> observers;
 91 //    string action;
 92 public:
 93     virtual void Attach(Observer* ob)
 94     {
 95         observers.push_back(ob);
 96     }
 97     virtual void Detach(Observer* ob)
 98     {
 99         list<Observer*>::iterator iter = find(observers.begin(), observers.end(), ob);
100         if (iter != observers.end())
101         {
102             observers.erase(iter);
103         }
104     }
105     virtual void Notify()
106     {
107         for (list<Observer*>::iterator iter = observers.begin(); iter != observers.end(); ++iter)
108         {
109             (*iter)->Update();
110         }
111     }
112     virtual void setAction(const string& s)
113     {
114         action = s;
115     }
116     virtual string getAction()
117     {
118         return action;
119     }
120 };
121 
122 
123 
124 int main()
125 {
126     Boss* huhansan = new Boss;
127     StockObserver* so = new StockObserver("abc", huhansan);
128     NBAObserver*   no = new NBAObserver("xyz", huhansan);
129 
130     huhansan->Attach(so);
131     huhansan->Attach(no);
132     huhansan->setAction("鎴戣儭姹変笁鍙堝洖鏉ヤ簡錛?/span>");
133     huhansan->Notify();
134 
135     huhansan->Detach(no);
136     huhansan->setAction("寮浼氾紒");
137     huhansan->Notify();
138 
139     delete huhansan;
140 
141     Secretary* s = new Secretary;
142     s->Attach(no);
143     s->Attach(so);
144     s->setAction("鑰佹澘鏉ヤ簡錛?/span>");
145     cout << s->getAction() << endl;
146     s->Notify();
147 
148     delete so;
149     delete no;
150     delete s;
151     
152     return 0;
153 }



]]>
C++璁捐妯″紡(杞澆)http://www.shnenglu.com/yehao/articles/144137.html鍘氱Н钖勫彂鍘氱Н钖勫彂Wed, 13 Apr 2011 09:47:00 GMThttp://www.shnenglu.com/yehao/articles/144137.htmlhttp://www.shnenglu.com/yehao/comments/144137.htmlhttp://www.shnenglu.com/yehao/articles/144137.html#Feedback0http://www.shnenglu.com/yehao/comments/commentRss/144137.htmlhttp://www.shnenglu.com/yehao/services/trackbacks/144137.html鏈枃鏉ヨ嚜CSDN鍗氬錛岃漿杞借鏍囨槑鍑哄錛?/span>http://blog.csdn.net/i_like_cpp/archive/2004/11/29/197760.aspx


涓銆佸姛鑳?/strong>

 

銆銆灝嗕竴涓被鐨勬帴鍙h漿鎹㈡垚瀹㈡埛甯屾湜鐨勫彟澶栦竴涓帴鍙o紝瑙e喅涓や釜宸叉湁鎺ュ彛涔嬮棿涓嶅尮閰嶇殑闂銆侫dapter妯″紡浣垮緱鍘熸湰鐢變簬鎺ュ彛涓嶅吋瀹硅屼笉鑳戒竴璧峰伐浣滅殑閭d簺綾誨彲浠ヤ竴璧峰伐浣溿?

銆銆浜屻佺粨鏋勫浘

銆銆(1)class adapter

銆銆(2)object adapter

涓夈佸疄鐜?/p>

銆銆鍜屽叾浠栧緢澶氭ā寮忎竴鏍鳳紝瀛︿範璁捐妯″紡鐨勯噸鐐規槸瀛︿範姣忕妯″紡鐨勬濇兂錛岃屼笉搴旀嫎娉ヤ簬瀹冪殑鏌愮鍏蜂綋緇撴瀯鍥懼拰瀹炵幇銆傚洜涓烘ā寮忔槸鐏墊椿鐨勶紝鍏跺疄鐜板彲浠ユ槸鍗冨彉涓囧寲鐨勶紝鍙槸鎵璋撲竾鍙樹笉紱誨叾瀹椼?鍦⊿TL涓ぇ閲忚繍鐢ㄤ簡Adapter妯″紡錛岃薄function adapter銆乮terator adpter錛屽畠浠笌榪欓噷璇寸殑adapter緇撴瀯騫朵笉涓鏍鳳紝浣嗘濇兂鏄竴鏍風殑銆傚叿浣撶殑浠嬬粛鍙埌渚嵎緗戠珯涓婃壘鐩稿叧鏂囩珷錛屼粬璁插緱闈炲父濂姐?
銆銆鍥涖佺ず渚嬩唬鐮?/p>

銆銆(1)class adapter

namespace DesignPattern_Adapter
{
// class Adaptee
class Adaptee
{
public:
void SpecialRequest() {}
} ;

// class Target
class Target
{
public:
virtual void Request() = 0 ;
} ;

// class Adapter
class Adapter : public Target, private Adaptee
{
public:
virtual void Request() { SpecialRequest() ; }
} ;
}

瀹㈡埛绔唬鐮侊細
{
using namespace DesignPattern_Adapter ;
Target *p = new Adapter() ;
p->Request() ; //瀹為檯涓婅皟鐢ㄧ殑鏄疉daptee::SpecialRequest()
}
 

(2)object adapter namespace DesignPattern_Adapter


{
// class Adaptee
class Adaptee
{
public:
void SpecialRequest() {}
} ;

// class Target
class Target
{
public:
virtual void Request() = 0 ;
} ;

// class Adapter
class Adapter : public Target
{
public:
virtual void Request() { _adaptee.SpecialRequest() ; }
private:
Adaptee _adaptee ;
} ;
}

瀹㈡埛绔唬鐮侊細
{
using namespace DesignPattern_Adapter ;
Target *p = new Adapter() ;
p->Request() ; //瀹為檯涓婅皟鐢ㄧ殑鏄疉daptee::SpecialRequest()
}
 

銆銆鍏佸疄渚?/p>

銆銆(1)STL涓殑Class Adapter

銆銆STL涓殑Adapter Class鍖呮嫭錛歛.stack(瀵瑰簲鐨刟daptee鏄痙eque)銆俠.queue(瀵瑰簲鐨刟daptee鏄痙eque)銆俢.priority_queue(瀵瑰簲鐨刟daptee鏄痸ector)銆?涓嬮潰鏄粠VC涓殑< stack >鎷峰嚭鐨剆tack鐨勭被瀹氫箟錛?

templateclass _Container = deque<_Ty> >
class stack
{ // LIFO queue implemented with a container
public:
typedef _Container container_type;
typedef typename _Container::value_type value_type;
typedef typename _Container::size_type size_type;

stack()
: c()
{ // construct with empty container
}

explicit stack(const _Container& _Cont)
: c(_Cont)
{ // construct by copying specified container
}

bool empty() const
{ // test if stack is empty
return (c.empty());
}

size_type size() const
{ // test length of stack
return (c.size());
}

value_type& top()
{ // return last element of mutable stack
return (c.back());
}

const value_type& top() const
{ // return last element of nonmutable stack
return (c.back());
}

void push(const value_type& _Val)
{ // insert element at end
c.push_back(_Val);
}

void pop()
{ // erase last element
c.pop_back();
}

bool _Eq(const stack<_Ty, _Container>& _Right) const
{ // test for stack equality
return (c == _Right.c);
}

bool _Lt(const stack<_Ty, _Container>& _Right) const
{ // test if this < _Right for stacks
return (c < _Right.c);
}

protected:
_Container c; // the underlying container
};
 

銆銆鍏抽敭涔嬪鍦ㄤ簬_Container c錛宻tack鎵鏈夌殑鎿嶄綔閮借漿浜ょ粰c鍘誨鐞嗕簡銆?榪欏疄闄呬笂灝辨槸鍓嶉潰鎵璇寸殑"object adapter"錛屾敞鎰廠TL涓殑class adapter涓庝笂闈㈡墍璇寸殑class adapter姒傚康涓嶅畬鍏ㄤ竴鑷?
stack鐨勪嬌鐢ㄦ柟娉曞緢綆鍗曪紝濡備笅錛?

 

{
int ia[] = { 1,3,2,4 };
deque id(ia, ia+4);
stack is(id);
}

銆銆(2)榪戞棩鐪嬩簡涓綃囨枃绔?#8220;Generic< Programming >錛氱畝鍖栧紓甯稿畨鍏ㄤ唬鐮?#8221;錛屽師鏂囧嚭鑷?a C++ View絎?鏈?銆?鏂囩珷緇濆涓嫻侊紝浣滆呯粰鍑虹殑浠g爜涓篃浣跨敤浜咥daptor妯″紡錛屼篃鏈変竴瀹氫唬琛ㄦс傛垜灝嗗叾闂涓鑸寲錛屾鎷嚭浠ヤ笅紺轟緥錛?

銆銆闂錛氬亣璁炬湁鍑犱釜宸叉湁綾伙紝浠栦滑鏈夋煇浜涘叡鍚岀殑琛屼負錛屼絾瀹冧滑褰兼闂存槸鐙珛鐨?娌℃湁鍏卞悓鐨勫熀綾?銆傚錛?

class T1
{
public:
void Proc() {}
} ;

class T2
{
public:
void Proc() {}
} ;

// ...
 


銆銆濡備綍浠ョ粺涓鐨勬柟寮忓幓璋冪敤榪欎簺琛屼負鍛紵

銆銆瑙e喅鏂規硶1錛氬緢鑷劧鐨勪細鎯沖埌鐢ㄦā鏉匡紝濡傦細

template <class T>
void Test(T t)
{
t.Proc() ;


銆銆鐨勭‘涓嶉敊錛屼絾榪欏彧閫傜敤浜庣畝鍗曠殑鎯呭喌錛屾湁鏃舵儏鍐墊槸寰堝鏉傜殑錛屾瘮濡傛垜浠棤娉曟妸綾誨瀷鏀懼埌妯℃澘鍙傛暟涓紒

銆銆瑙e喅鏂規硶2錛氬洶闅炬潵鑷簬榪欎簺綾繪病鏈夊叡鍚岀殑鍩虹被錛屾墍浠ユ垜浠氨鍒涢犱竴涓熀綾伙紝鐒跺悗鍐岮dapt銆?

// class IAdaptor錛屾娊璞″熀綾?br>class IAdaptor
{
public:
virtual void Proc() = 0 ;
} ;
// class Adaptor
template <class T>
class Adaptor : public IAdaptor, private T //瀹炵幇緇ф壙
{
public:
virtual void Proc() { T::Proc() ; }
} ;
// 浠ョ粺涓鏂瑰紡璋冪敤鍑芥暟Proc錛岃屼笉鍏沖績鏄疶1銆乀2鎴栧叾浠栦粈涔堢被
void Test(const std::auto_ptr& sp)
{
sp->Proc() ;
}
瀹㈡埛绔唬鐮侊細
Test(std::auto_ptr(new Adaptor)) ;
Test(std::auto_ptr(new Adaptor)) ; 


銆銆涓婁緥寰堢畝鍗曪紝鐢ㄦ柟娉曚竴涓殑妯℃澘鍑芥暟灝卞彲浠ュ緢濂藉湴瑙e喅浜嗐備笅闈㈡槸涓涓暐寰鏉備竴鐐圭殑渚嬪瓙錛屾牴鎹弬鏁扮被鍨嬫潵鍒涘緩閫傚綋鐨勫璞★細

 

class T1
{
public:
T1(int) { /*...*/ }
void Proc() { /*...*/ }
} ;

class T2
{
public:
T2(char) { /*...*/ }
void Proc() { /*...*/ }
} ;

// class IAdaptor錛屾娊璞″熀綾?br>class IAdaptor
{
public:
virtual void Proc() = 0 ;
} ;

// class Adaptor
template
class Adaptor : public IAdaptor, private T //瀹炵幇緇ф壙
{
public:
Adaptor(int n) : T(n) {}
Adaptor(char c) : T(c) {}
virtual void Proc() { T::Proc() ; }
} ;

class Test
{
public:
Test(int n) : sp(new Adaptor(n)) {}
Test(char c) : sp(new Adaptor(c)) {}

void Proc() { sp->Proc() ; }
private:
std::auto_ptr sp ;
} ;

瀹㈡埛绔唬鐮侊細
Test t1(10) ;
t1.Proc() ;

Test t2('c') ;
t2.Proc() ;
 

銆銆涓婇潰鏄ず渚嬭岄潪瀹炰緥錛屼綘涔熻鏇存効鎰忕湅鐪嬪畠瀹為檯鐨勮繍鐢ㄣ傚幓涓嬭澆浣滆呮墍鍐欑殑浠g爜錛屽ソ濂芥璧忎竴涓嬪惂銆?br>
C++璁捐妯″紡涔婣bstract Factory
2002-07-23· · ··COM闆嗕腑钀?br>
銆銆涓銆佸姛鑳?/strong>
銆銆鎻愪緵涓涓垱寤轟竴緋誨垪鐩稿叧鎴栫浉浜掍緷璧栧璞$殑鎺ュ彛錛岃屾棤闇鎸囧畾瀹冧滑鍏蜂綋鐨勭被銆?

銆銆浜屻佺粨鏋勫浘

銆銆綾誨巶鏈鍩烘湰鐨勭粨鏋勭ず鎰忓浘濡備笅錛?

 

銆銆鍦ㄥ疄闄呭簲鐢ㄤ腑錛岀被鍘傛ā寮忓彲浠ユ墿鍏呭埌寰堝鏉傜殑鎯呭喌錛屽涓嬪浘鎵紺猴細

 


涓夈佷紭緙虹偣

銆銆浼樼偣錛?1)灝佽鍒涘緩榪囩▼銆傚鎴蜂笉鐢ㄧ煡閬撶被鍘傛槸濡備綍鍒涘緩綾誨疄渚嬬殑錛岀被鍘傚皝闂簡鎵鏈夊垱寤虹殑緇嗚妭銆傝繖鏍峰彲閫夋嫨涓嶅悓鐨勫垱寤烘柟娉曪紝澧炲姞浜嗙伒媧繪с?(2)灝嗗鎴蜂笌鍏蜂綋綾婚殧紱伙紝鎻愰珮浜嗗悇鑷殑鍙噸鐢ㄦс?
銆銆緙虹偣錛欶actory綾誨眰嬈′笌鍏蜂綋綾誨眰嬈¢氬父鏄鉤琛岀殑(鍗充竴涓瀵瑰簲鐨?銆傚鍔犱竴涓叿浣撶被錛屼竴鑸篃瑕佺浉搴斿湴澧炲姞涓涓猣actory綾伙紝澧炲姞浜嗙郴緇熷鏉傚害銆?

銆銆鍥涖佸疄鐜?/p>

銆銆(1)Abstract Factory綾諱腑閫氬父鏄竴緇凢actory Method鐨勯泦鍚堛備釜浜鴻涓轟笌Factory Method妯″紡娌℃湁鏈川鍖哄埆銆?

銆銆(2)閫氬父鍙互鎶婂伐鍘備綔涓哄崟浠躲?
銆銆浜斻佺ず渚嬩唬鐮?/p>

namespace DesignPattern_AbstractFactory

{

銆銆class AbstractProductA {}; // Product A

銆銆class ProductA1 : public AbstractProductA {};

銆銆class ProductA2 : public AbstractProductA {};

銆銆class AbstractProductB {}; // Product B
銆銆class ProductB1 : public AbstractProductB {};
銆銆class ProductB2 : public AbstractProductB {};
銆銆class AbstractFactory
銆銆{
銆銆public:
銆銆銆銆virtual AbstractProductA* CreateProductA() = 0 ;// 鍒涘緩ProductA
銆銆銆銆virtual AbstractProductB* CreateProductB() = 0 ;// 鍒涘緩ProductB
} ;
銆銆class ConcreteFactory1 : public AbstractFactory
銆銆{
銆銆public:
銆銆銆銆virtual AbstractProductA* CreateProductA() { return new ProductA1() ; }
銆銆銆銆virtual AbstractProductB* CreateProductB() { return new ProductB1() ; }
銆銆銆銆static ConcreteFactory1* Instance() { static ConcreteFactory1 instance ; return &instance ; } 銆銆
protected:
銆銆銆銆ConcreteFactory1() {}
銆銆private:
銆銆銆銆ConcreteFactory1(const ConcreteFactory1&) ;
銆銆銆銆ConcreteFactory1& operator=(const ConcreteFactory1&) ;
銆銆} ;
銆銆class ConcreteFactory2 : public AbstractFactory
銆銆{
銆銆public:
銆銆銆銆virtual AbstractProductA* CreateProductA() { return new ProductA2() ; }
銆銆銆銆virtual AbstractProductB* CreateProductB() { return new ProductB2() ; }
銆銆銆銆static ConcreteFactory2* Instance() { static ConcreteFactory2 instance ; return &instance ; }
銆銆protected:
銆銆銆銆ConcreteFactory2() {}
銆銆private:
銆銆銆銆ConcreteFactory2(const ConcreteFactory2&) ;
銆銆銆銆ConcreteFactory2& operator=(const ConcreteFactory2&) ;
銆銆} ;
}

瀹㈡埛绔唬鐮侊細

{
銆銆using namespace DesignPattern_AbstractFactory ;
銆銆// 絎竴縐嶅垱寤烘柟娉?/p>

銆銆AbstractFactory *pFactory = ConcreteFactory1::Instance() ;
銆銆AbstractProductA *pProductA = pFactory->CreateProductA() ;
銆銆AbstractProductB *pProductB = pFactory->CreateProductB() ;

銆銆// 絎簩縐嶅垱寤烘柟娉?br>銆銆pFactory = ConcreteFactory2::Instance() ;
銆銆pProductA = pFactory->CreateProductA() ;
銆銆pProductB = pFactory->CreateProductB() ;
}

銆銆鍏佸疄渚?/p>

銆銆鏈鏃╃煡閬撶被鍘傜殑姒傚康鏄湪COM涓紝浣嗗綋鏃朵篃娌℃兂鍒拌繖鏄姝ら噸瑕佺殑涓縐嶆ā寮忥紝鍦ㄨ澶氬叾浠栨ā寮忎腑閮藉彲浠ョ敤鍒扮被鍘傛ā寮忋?COM涓笉鑳界洿鎺ュ垱寤虹粍浠訛紝榪欎篃鏄敱COM鐨勪竴涓壒鎬у喅瀹氱殑錛氬嵆瀹㈡埛涓嶇煡閬撹鍒涘緩鐨勭粍浠剁殑綾誨悕銆?/p>

C++璁捐妯″紡涔婼ingleton
2002-07-26· · ··COM闆嗕腑钀?

銆銆涓銆佸姛鑳?

銆銆淇濊瘉涓涓被浠呮湁涓涓疄渚嬨?

銆銆浜屻佺粨鏋勫浘



涓夈佷紭緙虹偣

銆銆Singleton妯″紡鏄仛涓?鍏ㄥ眬鍙橀噺"鐨勬浛浠e搧鍑虹幇鐨勩傛墍浠ュ畠鍏鋒湁鍏ㄥ眬鍙橀噺鐨勭壒鐐癸細鍏ㄥ眬鍙銆佽瘡絀垮簲鐢ㄧ▼搴忕殑鏁翠釜鐢熷懡鏈燂紝瀹冧篃鍏鋒湁鍏ㄥ眬鍙橀噺涓嶅叿澶囩殑鎬ц川錛氬悓綾誨瀷鐨勫璞″疄渚嬪彧鍙兘鏈変竴涓?

銆銆鍥涖佸疄鐜?/p>

銆銆鏁欑涔︿笂鐨凷ingleton瀹氫箟濡備笅錛?


class Singleton
{
public:
static Singleton* Instance() ;
protected:
Singleton() {}
private:
static Singleton *_instance ;
Singleton(const Singleton&) ;
Singleton& operator=(const Singleton&) ;
} ;

Singleton* Singleton::_instance = NULL ;

Singleton* Singleton::Instance()
{
(_instance == NULL) ? _instance = new Singleton() : 0 ; //lazy initialization
return _instance ;
}
 

銆銆(1)鍥犱負榪斿洖鐨勬槸鎸囬拡錛屼負闃叉鐢ㄦ埛璋冪敤delete鍑芥暟錛屽彲鎶妔tatic Singleton *_instance錛涙敼涓哄湪Instance()涓畾涔塻tatic Singleton _instance銆傝繖鏍鋒樉鐒舵洿瀹夊叏錛屽悓鏃朵篃鍏鋒湁lazy initialization鐨勭壒鎬?鍗崇涓嬈¤闂椂鎵嶅垱寤?銆?

銆銆(2)鍋囪闇瑕佷粠Singleton媧劇敓瀛愮被錛岃屽瓙綾諱篃闇瑕佹湁鍚屾牱鐨勬ц川錛屾棦鍙兘鍒涘緩涓涓疄渚嬨傛垜瑙夊緱錛岃繖寰堥毦鍔炪傛牴鏈師鍥犲湪浜嶪nstance()鍑芥暟涓嶆槸铏氬嚱鏁幫紝涓嶅叿鏈夊鎬佺殑鎬ц川銆備竴縐嶅父鐢ㄦ柟娉曟槸鎶奍nstance()鍑芥暟縐誨埌瀛愮被涓紝榪欐椂灝卞彧鑳界敤static Singleton *_instance錛岃屼笉鑳界敤static Singleton _instance浜嗭紝闄ら潪鎶奯instance涔熻縐誨埌瀛愮被錛屾棤璁烘庝箞鍋氶兘涓嶄紭闆呫傚彟涓縐嶆柟娉曟槸鐢ㄦā鏉褲傚叿浣撶敤浠涔堟柟娉曪紝鍙兘鏍規嵁瀹為檯鎯呭喌鏉冭 銆?

銆銆浜斻佺ず渚嬩唬鐮?/p>

銆銆(1)娌″瓙綾葷殑鎯呭喌

namespace DesignPattern_Singleton
{

class Singleton
{
public:
static Singleton* Instance() { static Singleton _instance ; return &_instance ; }
protected:
Singleton() {}
private:
Singleton(const Singleton&) ;
Singleton& operator=(const Singleton&) ;
} ;
}

瀹㈡埛绔唬鐮侊細
{
using namespace DesignPattern_Singleton ;
Singleton *p = Singleton::Instance() ;
......
}
 

銆銆(2)鏈夊瓙綾葷殑鎯呭喌


鏂規硶涓錛?br>namespace DesignPattern_Singleton
{
// class Singleton
class Singleton
{
protected:
Singleton() {}
static Singleton *_instance ;
private:
Singleton(const Singleton&) ;
Singleton& operator=(const Singleton&) ;
} ;
Singleton* Singleton::_instance = NULL ;

// class ConcreteSingleton
class ConcreteSingleton : public Singleton
{
public:
static Singleton* Instance() ;
protected:
ConcreteSingleton() {}
} ;

Singleton* ConcreteSingleton::Instance()
{
(_instance == NULL) ? _instance = new ConcreteSingleton() : 0 ;
return _instance ;
}
}

瀹㈡埛绔唬鐮侊細
{
using namespace DesignPattern_Singleton ;
Singleton *p = ConcreteSingleton::Instance() ;
}

鏂規硶浜岋細
namespace DesignPattern_Singleton
{
// class Singleton
class Singleton
{
protected:
Singleton() {}
private:
Singleton(const Singleton&) ;
Singleton& operator=(const Singleton&) ;
} ;

// class ConcreteSingleton
class ConcreteSingleton : public Singleton
{
public:
static Singleton* Instance() { static ConcreteSingleton _instance ; return &_instance ; }
protected:
ConcreteSingleton() {}
} ;
}

瀹㈡埛绔唬鐮侊細
{
using namespace DesignPattern_Singleton ;
Singleton *p = ConcreteSingleton::Instance() ;
}

鏂規硶涓夛細
namespace DesignPattern_Singleton
{
template < class T >
class Singleton
{
public:
static T* Instance() { static T _instance ; return &_instance ; }
protected:
Singleton() {}
private:
Singleton(const Singleton &) ;
Singleton& operator=(const Singleton&) ;
} ;

class ConcreteSingleton : public Singleton< ConcreteSingleton > {} ;
}

瀹㈡埛绔唬鐮?br>{
using namespace DesignPattern_Singleton ;

ConcreteSingleton *p = ConcreteSingleton::Instance() ;
}
 
 
C++妯″紡寮鍙戜箣Bridge
2002-07-29· · ··COM闆嗕腑钀?

銆銆涓銆佸姛鑳?/strong>
銆銆灝嗘娊璞¢儴鍒嗕笌瀹冪殑瀹炵幇閮ㄥ垎鍒嗙錛屼嬌瀹冧滑閮藉彲浠ョ嫭绔嬪湴鍙樺寲銆?

銆銆浜屻佺粨鏋勫浘


涓夈佺ず渚嬩唬鐮?
namespace DesignPattern_Bridge
{
// class Implementor
class Implementor
{
public:
virtual void OperationImp() = 0 ;
} ;

// class ConcreteImplementorA
class ConcreteImplementorA : public Implementor
{
public:
virtual void OperationImp() {}
} ;

// class ConcreteImplementorB
class ConcreteImplementorB : public Implementor
{
public:
virtual void OperationImp() {}
} ;

// class Abstraction
class Abstraction
{
public:
void Operation(Implementor* imp) { assert(imp) ; imp->OperationImp() ; }
} ;
}

瀹㈡埛绔唬鐮侊細
{
using namespace DesignPattern_Bridge ;

Abstraction obj ;
Implementor *impa = new ConcreteImplementorA() ;
Implementor *impb = new ConcreteImplementorB() ;
obj.Operation(impa) ; //絎竴縐嶅疄鐜版柟娉?br>obj.Operation(impb) ; //絎簩縐嶅疄鐜版柟娉?br>}
 


銆銆鍥涖佸疄渚?/p>

銆銆(1)鍒涘緩鍙互鍦╔ Window System鍜孖BM鐨凱resentation Manager緋葷粺涓兘鍙互浣跨敤鐨勭獥鍙c?涔︿笂鐨勪緥瀛?


Bridge鐨勯瓍鍔涘湪浜庢娊璞″拰瀹炵幇涔嬮棿鏄澗鏁g殑鍏崇郴錛屽畠浠箣闂村彲浠ヨ繘琛岄殢鎰忕粍鍚堛傚涓婂浘涓紝灝辨湁IconWindow+XWindowImp銆乀ransientWindow+XWindowImp銆両conWindow+PMWindowImp銆乀ransientWindow+PMWindowImp鍥涚緇勫悎銆?br>
C++妯″紡璁捐涔婤uilder
2002-07-30· · ··COM闆嗕腑钀?

銆銆涓銆佸姛鑳?/strong>

銆銆灝嗕竴涓鏉傚璞$殑鏋勫緩涓庡畠鐨勮〃紺哄垎紱伙紝浣垮緱鍚屾牱鐨勬瀯寤鴻繃紼嬪彲浠?strong>鍒涘緩涓嶅悓鐨勮〃紺?/strong>銆?

銆銆浜屻佺粨鏋勫浘

鍚勭被涔嬮棿鐨勪氦浜掑叧緋誨涓嬪浘鎵紺猴細


涓夈佺ず渚嬩唬鐮?

namespace DesignPattern_Builder
{
class Product1 { /*...*/ } ;
class Product2 { /*...*/ } ;

// class Builder
class Builder //鎶借薄鍩虹被
{
public:
virtual void BuilderPartA() {} //鎻愪緵緙虹渷瀹炵幇
virtual void BuilderPartB() {}
virtual void BuilderPartC() {}
protected:
Builder() {}
} ;

// class ConcreteBuilder1
class ConcreteBuilder1 : public Builder //鍒涘緩Product1
{
public:
ConcreteBuilder1() : _product(NULL) {}

virtual void BuilderPartA() { /*...*/ }
virtual void BuilderPartB() { /*...*/ }
virtual void BuilderPartC() { /*...*/ }

virtual Product1* GetProduct1() { return _product ; } //榪斿洖鍒涘緩鐨凱roduct1瀵硅薄
private:
Product1 *_product ;
} ;

// class ConcreteBuilder2
class ConcreteBuilder2 : public Builder //鍒涘緩Product2
{
public:
ConcreteBuilder2() : _product(NULL) {}

virtual void BuilderPartA() { /*...*/ }
virtual void BuilderPartB() { /*...*/ }
virtual void BuilderPartC() { /*...*/ }

virtual Product2* GetProduct2() { return _product ; } //榪斿洖鍒涘緩鐨凱roduct2瀵硅薄
private:
Product2 *_product ;
} ;

// class Director
class Director
{
public:
//鍒涘緩瀵硅薄(Director騫朵笉鐭ラ亾鍏蜂綋鍒涘緩鍑烘潵鐨勫璞℃槸浠涔堟牱鐨勶紝鍙湁璋冪敤璇ュ嚱鏁扮殑client鐭ラ亾)
void Construct(Builder *builder)
{
builder->BuilderPartA() ;
builder->BuilderPartB() ;
builder->BuilderPartC() ;
}
} ;
}

瀹㈡埛绔唬鐮侊細
{
using namespace DesignPattern_Builder ;

Director director ;

// 鍒涘緩絎竴縐嶅璞?br>ConcreteBuilder1 *pBuilder1 = new ConcreteBuilder1() ;
director.Construct(pBuilder1) ;
Product1 *product1 = pBuilder1->GetProduct1() ;

// 鍒涘緩絎簩縐嶅璞?br>ConcreteBuilder2 *pBuilder2 = new ConcreteBuilder2() ;
director.Construct(pBuilder2) ;
Product2 *product2 = pBuilder2->GetProduct2() ;
}
 


銆銆鍥涖佸疄渚?/p>

銆銆(1)渚嬪瓙涓銆傚涓嬪浘鎵紺猴細



涓婂浘鐨勫姛鑳芥槸鏄妸涓涓猂TF鏂囦歡杞崲涓哄縐嶆鏂囨牸寮忋俁TFReader榪涜璇硶鍒嗘瀽錛岀劧鍚庡皢鎵鏈夌殑token涓查愪竴杞崲銆傚彲瑙乥uilder灝辨槸涓姝ユ鍦版妸鍚勪釜閮ㄥ垎緇勮涓轟竴涓暣浣撱傚畠灝侀棴浜嗙粍瑁呯殑鏂規硶錛岀粍瑁呭嚭鏉ョ殑瀵硅薄涔熷ぇ鐩稿緞搴?br>
C++璁捐妯″紡涔婸rototype
2002-08-01· · ··COM闆嗕腑钀?

銆銆涓銆佸姛鑳?/strong>

銆銆鐢ㄥ師鍨嬪疄渚嬫寚瀹氬垱寤哄璞$殑縐嶇被錛屽茍涓旈氳繃鎷瘋礉榪欎簺鍘熷瀷鍒涘緩鏂扮殑瀵硅薄銆?



銆銆浜屻佺粨鏋勫浘


涓夈佷紭緙虹偣

銆銆浼樼偣錛氬鍒惰嚜韜傚鎴蜂笉鐭ラ亾闇瑕佸璞$殑瀹為檯綾誨瀷錛屽彧闇鐭ラ亾瀹冪殑鎶借薄鍩虹被鍗沖彲銆?鍗蟲湁緇ф壙鏍戠殑鎯呭喌)

銆銆緙虹偣錛氬繀欏誨厛鏈変竴涓璞″疄渚?鍗沖師鍨?鎵嶈兘clone銆?

銆銆鍥涖佺ず渚嬩唬鐮?/p>

namespace DesignPattern_Prototype
{
// class Prototype
class Prototype //鎶借薄鍩虹被
{
public:
virtual Prototype* Clone() = 0 ;
} ;

// class ConcretePrototype1
class ConcretePrototype1 : public Prototype
{
public:
virtual Prototype* Clone()
{
ConcretePrototype1 *p = new ConcretePrototype1() ;
*p = *this ; //澶嶅埗瀵硅薄
return p ;
}
} ;

// class ConcretePrototype2
class ConcretePrototype2 : public Prototype
{
public:
virtual Prototype* Clone()
{
ConcretePrototype2 *p = new ConcretePrototype2() ;
*p = *this ; //澶嶅埗瀵硅薄
return p ;
}
} ;
}

瀹㈡埛绔唬鐮侊細
{
using namespace DesignPattern_Prototype ;

ConcretePrototype1 *obj1 = new ConcretePrototype1() ;//鍘熷瀷瀵硅薄1
ConcretePrototype2 *obj2 = new ConcretePrototype2() ;//鍘熷瀷瀵硅薄2

Prototype *newobj1 = obj1->Clone() ;//鍏嬮殕瀵硅薄1
Prototype *newobj2 = obj2->Clone() ;//鍏嬮殕瀵硅薄2

//浣跨敤澶嶅埗鍑虹殑瀵硅薄newobj1鍜宯ewobj2
}
 

銆銆浜斻佸疄渚?/p>

    銆鍦ㄤ竴涓浘褰㈢紪杈戝櫒涓紝姣忎竴涓浘褰㈠厓绱狅紝濡傜嚎銆佸渾銆佹枃瀛楃瓑閮藉簲璇ユ敮鎸佹嫹璐濇搷浣滐紝鍗崇偣涓浘褰紝鎸変笅Ctrl+C錛屽啀鎸変笅Ctrl+V鍚庡氨浼氬鍒朵竴涓柊鐨勫浘褰€傛樉鐒惰繖鏄竴縐峜lone鎿嶄綔銆傛墍浠ュ湪姣忎釜浠嶨raphic媧劇敓鍑虹殑鍥懼艦瀛愮被閮藉簲榪愮敤Prototype妯″紡錛屽姞涓奀lone鎿嶄綔銆?br> 

C++璁捐妯″紡涔婩actory Method
2002-08-05· · ··COM闆嗕腑钀?

銆銆涓銆佸姛鑳?/strong>

銆銆瀹氫箟涓涓敤浜庡垱寤哄璞$殑鎺ュ彛錛岃瀛愮被鍐沖畾瀹炰緥鍖栧摢涓涓被銆侳actory Method 浣夸竴涓被鐨勫疄渚嬪寲寤惰繜鍒板叾瀛愮被銆?

銆銆浜屻佺粨鏋勫浘


涓夈佸疄鐜?/p>

(1)鍦ㄦ煇浜涙儏鍐典笅錛屾瘮濡備粎浠呬負浜嗗垱寤洪傚綋鐨凱roduct瀵硅薄鑰屾淳鐢熸柊鐨凜reator瀛愮被錛屽茍涓斿垱寤轟笉鍚孭roduct鐨勬柟娉曚竴鑷存椂錛屽彲浠ヨ冭檻鐢ㄦā鏉夸唬鏇跨戶鎵褲傚錛?

class Creator
{
public:
virtual Product* CreateProduct() = 0 ;
};

template < class ConcreteProduct >
class ConcreteCreator: public Creator
{
public:
virtual Product* CreateProduct() { return new ConcreteProduct() ; }
};

  銆銆妯℃澘涓庣戶鎵跨殑鏈川鍖哄埆涔嬩竴鏄細妯℃澘錛氳涓轟笉渚濊禆浜庣被鍨嬨傜戶鎵匡細琛屼負渚濊禆浜庣被鍨嬨?Effective C++ Item 41) 浜嬪疄涓婏紝鍦ㄥ緢澶氭ā寮忎腑閮藉瓨鍦ㄧ潃鍙互鐢ㄦā鏉夸唬鏇跨戶鎵跨殑鎯呭喌錛屽叾鏍規湰鍘熷洜灝卞湪浜庡瓙綾葷殑琛屼負鏄竴鑷寸殑銆?

銆銆鍥涖佺ず渚嬩唬鐮?/p>

namespace DesignPattern_FactoryMethod
{
class Product { /*...*/ } ;
class ConcreteProduct : public Product { /*...*/ } ;

// class Creator
class Creator
{
public:
virtual Product* CreateProduct() = 0 ;
void Operate() ;
} ;

void Creator::Operate()
{
// ...
Product *p = CreateProduct() ;
// ...
}

// class ConcreteCreator
class ConcreteCreator : public Creator
{
public:
virtual Product* CreateProduct() { return new ConcreteProduct() ; }
} ;
}

瀹㈡埛绔唬鐮侊細
{
using namespace DesignPattern_FactoryMethod ;
ConcreteCreator p ;
p.Operate() ;
}
 

  銆銆榪欓噷鐨凜reateProduct鍏跺疄涔熸槸涓涓猅emplate Method銆?

銆銆浜斻佸疄渚?/p>

銆銆Factory Method鐨勮繍鐢ㄥお騫挎硾浜嗭紝瀹冪粡甯歌繍鐢ㄥ湪鍏跺畠妯″紡涓紝鍏跺疄渚嬩婦涓嶈儨鏁般?
(1)


MFC涓殑CDocument綾誨氨鍖呭惈浜嗙被浼間簬涓婂浘CApplication涓殑涓変釜鍑芥暟銆傝繖閲岀殑CreateDocument灝辨槸涓涓猣actory method錛屽洜涓哄畠璐熻矗鍒涘緩涓涓枃妗e璞°?

銆銆(2)


褰撲竴涓被灝嗗畠鐨勪竴浜涜亴璐e鎵樼粰涓涓嫭绔嬬殑綾繪椂錛屽氨浜х敓浜?strong>騫寵綾誨眰嬈?/strong>銆備笂鍥句腑Figure鍜孧anipulator灝辨槸騫寵綾誨眰嬈★紝Figure浠h〃涓浜涘浘褰㈠厓绱狅紝濡傜嚎銆佹枃瀛楃瓑錛孧anipulator琛ㄧず浣滅敤浜庤繖浜涘浘褰㈠厓绱犵殑鎿嶄綔錛屽鎷栨媺銆佺Щ鍔ㄣ侀変腑絳夈傚鏋滆繖浜涙搷浣滄墍闇瑕佺殑鐘舵佷俊鎭茍涓嶉渶瑕佷繚瀛樺湪Figure涓紝閭d箞鎶奆igure鍜孧anipulator鍒嗘垚涓や釜綾誨眰嬈℃槸涓ソ涓繪剰銆傝繖閲岀殑CreateManipulator灝辨槸涓涓猣actory method銆?br>
C++璁捐妯″紡涔婥omposite
2002-08-06· · ··COM闆嗕腑钀?

銆銆涓銆佸姛鑳?/strong>
銆銆琛ㄧず“閮ㄥ垎-鏁翠綋”鍏崇郴錛屽茍浣跨敤鎴蜂互涓鑷寸殑鏂瑰紡浣跨敤鍗曚釜瀵硅薄鍜岀粍鍚堝璞°?

銆銆浜屻佺粨鏋勫浘


涓婂浘涓紝涔熷彲浠ュ仛浜涙墿灞曪紝鏍規嵁闇瑕佸彲浠ュ皢Leaf鍜孋omposite鍋氫負鎶借薄鍩虹被錛屼粠涓淳鐢熷嚭瀛愮被鏉ャ?

銆銆涓夈佷紭緙虹偣

銆銆浼樼偣錛氬浜嶤omposite妯″紡錛屼篃璁鎬漢浠竴寮濮嬬殑娉ㄦ剰鍔涗細闆嗕腑鍦ㄥ畠鏄浣曞疄鐜扮粍鍚堝璞$殑銆備絾Composite鏈閲嶈涔嬪鍦ㄤ簬鐢ㄦ埛騫朵笉鍏沖績鏄粍鍚堝璞¤繕鏄崟涓璞★紝鐢ㄦ埛灝嗕互緇熶竴鐨勬柟寮忚繘琛屽鐞嗭紝鎵浠ュ熀綾誨簲鏄粠鍗曚釜瀵硅薄鍜岀粍鍚堝璞′腑鎻愬嚭鐨勫叕鍏辨帴鍙c?
銆銆緙虹偣錛欳omposite鏈澶х殑闂鍦ㄤ簬涓嶅鏄撻檺鍒剁粍鍚堜腑鐨勭粍浠躲?

銆銆鍥涖佸疄鐜?/p>

銆銆鏈夋椂闇瑕侀檺鍒剁粍鍚堜腑鐨勭粍浠訛紝鍗沖笇鏈涗竴涓狢omposite鍙兘鏈夋煇浜涚壒瀹氱殑Leaf銆傝繖涓棶棰樻垜鏄敤澶氱戶鎵垮拰鍔ㄦ佺被鍨嬭漿鎹㈡潵瑙e喅鐨勩傚亣濡傜粍鍚堝璞omposite1鍙兘鍖呭惈鍗曚釜瀵硅薄ConcreteLeaf1錛孋omposite2鍙互鍖呭惈鍗曚釜瀵硅薄ConcreteLeaf1鍜孋oncreteLeaf2銆傚涓嬪浘鎵紺猴細


涓婂浘涓殑綾誨眰嬈℃瘮杈冨錛屼嬌鐢ㄤ簡AbstractLeaf1鍜孉bstractLeaf2錛屼絾娌′嬌鐢ˋbstractComposite1鍜孉bstractComposite2錛岃繖涓茍涓嶉噸瑕侊紝涔熷彲浠ユ妸AbstractLeaf1鍜孉bstractLeaf2鍘繪帀錛岃繖涓茍涓嶉噸瑕侊紝鍙互鏍規嵁鍏蜂綋鎯呭喌鍐沖畾瑕佷笉瑕併?
綆鍗曠殑浠g爜瀹炵幇濡備笅錛?

namespace DesignPattern_Composite
{
class Component
{
public:
virtual void operation() = 0 ;
virtual void Add(Component*) {}
} ;

class AbstractComponent1 : virtual public Component {} ;

class AbstractLeaf1 : virtual public AbstractComponent1 {} ;

class Composite1 : public AbstractComponent1
{
public:
virtual void operation() { /* do operation */ }
virtual void Add(Component*) ;
} ;
void Composite1::Add(Component *p)
{
AbstractComponent1 *pc1 = dynamic_cast錛淎BSTRACTCOMPONENT1*錛?p) ;
if (pc1 == NULL) return ;
// do add operation
}

class AbstractComponent2 : virtual public Component {} ;

class AbstractLeaf2 : virtual public AbstractComponent2 {} ;

class Composite2 : public AbstractComponent2
{
public:
virtual void operation() { /* do operation */ }
virtual void Add(Component*) ;
} ;
void Composite2::Add(Component *p)
{
AbstractComponent2 *pc2 = dynamic_cast錛淎BSTRACTCOMPONENT2*>(p) ;
if (pc2 == NULL) return ;
// do add operation
}

class ConcreteLeaf1 : public AbstractLeaf1
{
public:
virtual void operation() { /* do operation */ }
} ;

class ConcreteLeaf2 : public AbstractLeaf1, public AbstractLeaf2
{
public:
virtual void operation() { /* do operation */ }
} ;
}

瀹㈡埛绔唬鐮侊細
锝?br>using namespace DesignPattern_Composite ;

Component *pc1 = new ConcreteLeaf1() ;
Component *pc2 = new ConcreteLeaf2() ;
Component *pc3 = new Composite1() ;
Component *pc4 = new Composite2() ;
pc3->Add(pc1) ; // ok
pc3->Add(pc2) ; // ok
pc3->Add(pc3) ; // ok
pc3->Add(pc4) ; // fail
pc4->Add(pc1) ; // fail
pc4->Add(pc2) ; // ok
pc4->Add(pc3) ; // fail
pc4->Add(pc4) ; // ok
}
 


銆銆鏈変袱鐐歸渶瑕佹敞鎰忥紝涓鏄洜涓虹敤浜嗗緇ф壙錛屾墍浠ラ渶瑕佷嬌鐢╲irtual inheritance銆備簩鏄鐢╠ynamic_cast鏉ュ垽鏂槸鍚﹀厑璁哥粍鍚堣緇勪歡銆?/p>

銆銆浜斻佺ず渚嬩唬鐮?/p>

namespace DesignPattern_Composite
{
// class Component
class Component
{
public:
virtual void Operation() = 0 ;
virtual void Add(Component*) {}
} ;

// class Leaf
class Leaf : public Component
{
public:
virtual void Operation() {}
} ;

// class Composite
class Composite : public Component
{
public:
virtual void Add(Component *p) { _list.push_back(p) ; }
virtual void Operation()
{
vector< Component* >::const_iterator it ;
for (it = _list.begin(); it != _list.end(); it++)
(*it)->Operation() ;
}
private:
vector< Component* > _list ;
} ;
}
 

銆銆鍏佸疄渚?/p>

銆銆(1)JUnit涓氨鐢ㄧ殑鏄疌omposite妯″紡銆?

 



]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久综合影视| 欧美视频专区一二在线观看| 国产欧美一区二区三区沐欲| 亚久久调教视频| 午夜伦理片一区| 一区二区亚洲| 亚洲肉体裸体xxxx137| 欧美激情综合在线| 亚洲尤物在线视频观看| 亚洲已满18点击进入久久| 国产麻豆精品视频| 美女国产精品| 欧美区一区二| 久久国产66| 六月婷婷久久| 亚洲专区在线视频| 久久国产日本精品| 亚洲精品久久久久久久久久久久| 亚洲日韩欧美视频| 国产欧美视频一区二区| 猛男gaygay欧美视频| 欧美激情一区二区| 久久国产日韩| 欧美日本免费一区二区三区| 亚洲欧美日韩综合一区| 久久久久久久999| 在线视频一区二区| 欧美中在线观看| 日韩午夜免费| 久久精品国产一区二区电影| 99re热这里只有精品免费视频| 亚洲一区图片| 亚洲日本成人| 欧美中文字幕在线| 亚洲男人的天堂在线| 老司机午夜精品| 久久精品欧美| 国产精品wwwwww| 亚洲高清网站| 一区二区在线观看av| 在线视频欧美精品| 亚洲精品色婷婷福利天堂| 午夜在线电影亚洲一区| 一本色道久久综合亚洲精品高清| 欧美在线视频全部完| 亚洲欧美另类中文字幕| 欧美成人乱码一区二区三区| 久久蜜桃资源一区二区老牛 | 久久亚洲图片| 欧美视频在线观看免费网址| 欧美成人免费在线观看| 国产一区二区电影在线观看| 99国产精品99久久久久久粉嫩| 在线欧美一区| 久久国产精品久久久久久电车| 亚洲一区二区三区中文字幕在线| 鲁大师成人一区二区三区| 久久婷婷av| 国产综合色在线| 午夜视频一区二区| 午夜国产精品视频免费体验区| 欧美精品一区在线| 亚洲人成网站在线观看播放| 在线精品视频免费观看| 久久久国产视频91| 久久天天躁狠狠躁夜夜av| 国产欧美日韩免费| 香蕉成人久久| 久久久久久久久一区二区| 国产女主播一区| 欧美伊人久久| 老鸭窝毛片一区二区三区| 国产在线精品自拍| 久久久久久夜精品精品免费| 久久综合伊人77777麻豆| 狠狠入ady亚洲精品经典电影| 欧美一区中文字幕| 理论片一区二区在线| 亚洲黄色一区二区三区| 欧美韩日一区二区三区| 日韩视频免费大全中文字幕| 亚洲无玛一区| 国产欧美日本在线| 久久精品视频在线播放| 欧美成人a视频| 日韩一区二区福利| 欧美性大战久久久久| 午夜精品在线视频| 牛牛影视久久网| 一本大道av伊人久久综合| 国产精品国产亚洲精品看不卡15| 亚洲免费在线电影| 欧美77777| 亚洲午夜国产一区99re久久| 国产欧美精品国产国产专区| 久久九九免费| 亚洲人午夜精品| 欧美一区高清| 最新日韩av| 国产伦精品一区二区三区在线观看 | 久久综合色播五月| 亚洲电影在线免费观看| 欧美日韩综合另类| 久久国产精品毛片| 亚洲精品国产无天堂网2021| 久久精品国产精品| 亚洲精品视频在线| 国产亚洲观看| 欧美日韩一区二区高清| 久久成人人人人精品欧| 亚洲美女视频| 欧美成人黄色小视频| 亚洲一区在线播放| 亚洲福利电影| 国产日韩亚洲欧美| 欧美精品一区二区高清在线观看| 亚洲免费在线看| 亚洲经典视频在线观看| 久久精品国产亚洲精品| 亚洲一区在线免费| 亚洲精品国产精品久久清纯直播 | 国产乱肥老妇国产一区二 | 久久频这里精品99香蕉| 在线午夜精品自拍| 欧美国产日韩一区二区| 久久久7777| 欧美一区二区三区播放老司机| 亚洲理伦电影| 亚洲国产精品视频| 精品成人在线视频| 国产亚洲aⅴaaaaaa毛片| 欧美日韩一区在线| 欧美大片免费观看| 麻豆精品在线视频| 久久夜色精品一区| 久久久99国产精品免费| 午夜精品影院| 欧美亚洲免费| 亚洲欧美另类久久久精品2019| 一本一本大道香蕉久在线精品| 亚洲国产激情| 伊人久久av导航| 欧美国产1区2区| 最新成人av在线| 尤物网精品视频| 狠狠色伊人亚洲综合成人| 国产精品综合久久久| 国产精品视频| 国产亚洲成精品久久| 国产亚洲欧美激情| 国产亚洲欧美一区二区| 国内成人精品一区| 伊人久久噜噜噜躁狠狠躁| 精品动漫3d一区二区三区| 狠狠综合久久| 91久久线看在观草草青青| 亚洲精品一二区| 宅男在线国产精品| 欧美一区二区三区久久精品茉莉花| 午夜视频一区二区| 久久久精品日韩欧美| 免费看的黄色欧美网站| 欧美激情视频一区二区三区在线播放 | 狠狠色狠狠色综合人人| 伊人久久婷婷色综合98网| 亚洲黑丝在线| 亚洲素人在线| 久久久天天操| 亚洲激情视频在线播放| 一区二区精品国产| 午夜精品福利一区二区蜜股av| 午夜一区在线| 欧美1区视频| 国产精品免费在线| 伊人久久综合| 亚洲主播在线观看| 老司机一区二区| 99精品99久久久久久宅男| 午夜精品国产| 欧美激情bt| 国产亚洲精品自拍| 日韩亚洲欧美一区二区三区| 午夜欧美电影在线观看| 欧美成人在线免费观看| 亚洲色图综合久久| 久久亚洲美女| 国产欧美精品日韩| 最新亚洲电影| 久久精品国产99精品国产亚洲性色| 欧美激情影院| 欧美在线免费观看视频| 欧美日本簧片| 在线观看日韩www视频免费| 亚洲一区二区三区高清不卡| 蜜臀av国产精品久久久久| 亚洲私人黄色宅男| 欧美精品一区二区三区一线天视频| 国产日韩精品视频一区| 亚洲深夜福利| 亚洲国产精彩中文乱码av在线播放|