• The answer you entered to the math problem is incorrect.
  • You have to leave an e-mail address.

Preview comment

Please solve the math problem above and type in the result. e.g. for 1+1, type 2
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
More information about formatting options
Mon, 2010-01-25 17:35

Singleton pattern for connect to databases.

Submitted by chatsiri on Mon, 2010-01-25 17:35.

Posted in | | | | chatsiri's blog | add new comment | quote | 849 reads »

Singleton concept for implemented configuration of code.C++ can
created instance of object after new driven class.

//main idea for create only one instace for config
//create instance
ConnectionDb &ConnectionDb::instance(){
if( !instance_ ){
instance_ = new ConnectByControlOne;
return *instance_;
}
}

Test source code after compiled Mongodb package for Linux.See below,It's show debug run by localhost.

From chatsiri.com

After write example code by Singleton concept.Code example [main],[connectiondb.cpp],[connectiondb.h]

From chatsiri.com

No one expect after play football with old friend( CPESRC'47 ).My
finger have symptom of broken bone.Doctor suggested splint of my
finger.Start time for splint my finger at January( New Year - -") to
February.It's not easy for touch-type for write code.This is end of time splint finger.

From chatsiri.com