// xmlTest.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include "FGConfig.h"
#include "Utils.h"
#include "persistable.h"
#include <iostream>
#include <string>
#include <boost/make_shared.hpp>
#include <boost/shared_ptr.hpp>
using namespace boost;
using namespace std;
using namespace xml_api;
class Person
{
public:
Person(){}
Person(string name):m_strName(name){}
void ShowMsg(){cout << m_strName << endl;}
~Person(){cout << "deconstruction" << endl;}
private:
string m_strName;
};
class Test
{
public:
Test(){}
~Test(){}
public:
boost::shared_ptr<Person> GetPerson();
};
boost::shared_ptr<Person> Test::GetPerson()
{
boost::shared_ptr<Person> person = boost::make_shared<Person>("ganquanfu");
return person;
}
int _tmain(int argc, _TCHAR* argv[])
{
Test test;
boost::shared_ptr<Person> myPerson = test.GetPerson();
cout << myPerson.use_count() << endl;
myPerson->ShowMsg();
int wait;
cin >> wait;
return 0;
}