POCOã©ã€ãã©ãªã«é¢ãã以åã®èšäº ïŒ Portable Components ïŒãç¶ããŠãPOCOã¢ããªã±ãŒã·ã§ã³ã¹ãããã€ã³ãšãServerApplicationãConsoleApplicationãªã©ã®æŽŸçç©ã«ã€ããŠã話ããããšæããŸãã
ã¢ããªã±ãŒã·ã§ã³ã¹ãããã€ã³ã¯ããœãããŠã§ã¢éçºãç°¡çŽ åããååãšããŠæéãç¯çŽããããã«èšèšãããŠããŸãã ãã®ã¹ãããã€ã³ã䜿çšãããšãã³ã³ãœãŒã«ã¢ããªã±ãŒã·ã§ã³ãWindowsãµãŒãã¹ãããã³UNIXããŒã¢ã³ãæ°åã§äœæã§ããŸãã
説æ
ã¢ããªã±ãŒã·ã§ã³ã®æŽŸçç©ã¯ã ã³ã³ãœãŒã«ãšãµãŒããŒã® 2ã€ã®ã°ã«ãŒãã«åããããŸã ã
æ©åšã«ã¯ãã¢ããªã±ãŒã·ã§ã³ã«å¿ èŠãªæ¬¡ã®ãã®ãå«ãŸããŸãã
- é«ã¬ãã«ã§ã³ãã³ãã©ã€ã³åŒæ°ãæäœããŸãã æ£èŠè¡šçŸã«åºã¥ããŠãã©ã¡ãŒã¿ãŒããã§ãã¯ããæŽæ°å€ããã§ãã¯ããã·ã¹ãã ããããŸãã
- UNIXããŒã¢ã³ãšWindowsãµãŒãã¹ãäœæããããã®ããŒã«ã
- æ§æã®èªã¿èŸŒã¿ãåŠçããŸãã ãã®é ç®ã¯ãææ°ã®ãœãããŠã§ã¢ã§ã¯éèŠã§ãã ãã®æ§æã«ããããããžã§ã¯ããå®å šã«åã³ã³ãã€ã«ããããšãªããããã°ã©ã ã®åäœãèšå®ã§ããŸãã ãã¡ã€ã«ãŸãã¯Windowsã¬ãžã¹ããªããããŠã³ããŒãã§ããŸãã
- ããã°ã©ã ã®åæåãšå®äºã POCOã¢ããªã±ãŒã·ã§ã³ã§ã®ããã°ã©ã ã®å¯¿åœã¯ããµã€ã¯ã«ïŒ åæå-ã¢ããªã±ãŒã·ã§ã³ã®å®è¡-ã·ã£ããããŠã³ã«åŸå±ããŠããŸãã ãã®é åºã«ãããã¢ããªã±ãŒã·ã§ã³ããŒããMainã«é 眮ããéèŠã§ãªããã®ããã¹ãŠé ãããšãã§ããŸãã
- ãã®ã³ã°ããŒã« æèœãªãã°åéã·ã¹ãã ãæéãšãéãç¯çŽã§ããããšã¯åšç¥ã®äºå®ã§ãã POCOã¯éåžžã«åŒ·åãªãã®ã³ã°ããŒã«ãæäŸããŸãã ãã°ã¯ãã³ã³ãœãŒã«ããã¡ã€ã«ãWindowsã€ãã³ããã°ãSYSLOGãµãŒããŒã«éä¿¡ã§ããŸãïŒããšãã°ãã·ã¹ãã ã®ããã«ããã¯ãããŒããã£ã¹ã¯ã®å ŽåïŒã ãããã®æ¹æ³ãçµã¿åãããŠãåãã£ãã«ã«ä»»æã®èšé²åœ¢åŒãèšå®ããããšãã§ããŸãã äžè¬çã«ãç§ã¯ééããªãããªãã玹ä»ããŸãéåžžã«åŒ·åãªããŒã«ã
- ã¢ããªã±ãŒã·ã§ã³ãµãã·ã¹ãã ã®äœæãã¢ãžã¥ãŒã«ãžã®èšèšãããã³åçã©ã€ãã©ãªãžã®ããã±ãŒãžåã ããã°ã©ã ãåã³ã³ãã€ã«ããã«ã¢ãžã¥ãŒã«ã亀æã§ããã¢ãžã¥ãŒã«åŒã·ã¹ãã ãäœæããããã®éåžžã«äŸ¿å©ãªããŒã«ã
ç·Žç¿ãã
ãã®ã¹ãããã€ã³ã䜿çšããŠããã°ã©ã ãäœæããã«ã¯ã Poco :: Util :: Applicationããç¶æ¿ãã次ã®ã¡ãœããããªãŒããŒããŒãããå¿ èŠããããŸãã
void initialize(Application& self) //
void uninitialize() //
void reinitialize(Application& self) //
void defineOptions() //
void handleOption() //
int main(const std::vector<std::string>& args) //
ã¢ããªã±ãŒã·ã§ã³èµ·åãªãã·ã§ã³
POCOã®ã¢ããªã±ãŒã·ã§ã³èµ·åãã©ã¡ãŒã¿ãŒã¯ãOptionã¯ã©ã¹ã䜿çšããŠå®è£ ãããŸãã
åãã©ã¡ãŒã¿ãŒã«ã¯æ¬¡ã®ããããã£ããããŸãã
- æ°å
- çãåå
- ãã£ã©ã¯ã¿ãŒåïŒ1æåïŒ
- 説æ
ãã©ã¡ãŒã¿ãŒã¯ã°ã«ãŒãåã§ãããªãã·ã§ã³ã«ããããšãã§ããŸãã åãã©ã¡ãŒã¿ãŒã«å€ããªããŒã¿ãŒãæ·»ä»ã§ããŸãã POCOã«ã¯ã2çš®é¡ã®ããªããŒã¿ãŒãäºåå®çŸ©ãããŠããŸããIntValidator-æ°å€ããã§ãã¯ããRegExpValidator-æ£èŠè¡šçŸã«æºæ ããŠããããã©ã¡ãŒã¿ãŒããã§ãã¯ããŸãã æ€èšŒã«åæ Œããªãã£ããã©ã¡ãŒã¿ãŒã䜿çšããŠããã°ã©ã ãèµ·åãããšãããã°ã©ã ã¯ãšã©ãŒãè¿ãããã¹ãŠã®å¯èœãªãªãã·ã§ã³ã衚瀺ããŸãããããã®ãªãã·ã§ã³ã¯èªåçã«çæãããŸãã ãã©ã¡ãŒã¿ãŒã®é¢æ°ãã³ãã©ãŒïŒã³ãŒã«ããã¯ïŒãããã³ã°ã¢ãããã§ããŸãããããã®ãã©ã¡ãŒã¿ãŒã¯ãåæåäžã«äœ¿çšãããå Žåã«åŒã³åºãããŸãã
class myApp : public Application { public: myApp(int argc, char** argv) : Application(argc,argv) {} void initialize(Application& self) { cout << "" << endl; loadConfiguration(); // Application::initialize(self); } void reinitialize() { cout << "" << endl; Application::uninitialize(); } void uninitialize(Application& self) { cout << "" << endl; Application::reinitialize(self); } void HelpHim(const std::string& name, const std::string& value) { cout << " - " << endl; } void Configure(const std::string& name, const std::string& value) { cout << " " << endl; } void defineOptions(OptionSet& options) { cout << " " << endl; Application::defineOptions(options); options.addOption( Option("help", "h", " . ") .required(false) // .repeatable(false) // //myApp::handleOption - - .callback(OptionCallback<myApp>(this, &myApp::handleOption))); options.addOption( Option("config-file", "f", " ") .required(false) .repeatable(true) .argument("file") .callback(OptionCallback<myApp>(this, &myApp::Configure))); options.addOption( Option("bind", "b", " =") .required(false) // - .argument("value") // , , [0; 100] .validator(new IntValidator(0, 100)) .binding("test.property")); // } int main(const std::vector<std::string>& args) { cout << " -" << endl; } }; // POCO_APP_MAIN - : // int wmain(int argc, wchar_t** argv) // { // myApp A(argc,argv); // return A.run(); // } POCO_APP_MAIN(myApp)
UNIXããŒã¢ã³ãšWindowsãµãŒãã¹ãäœæããããã®ããŒã«ã
ãµãŒããŒãäœæããã«ã¯ããã®ããã»ã¹ãå¥ã®ãŠãŒã¶ãŒïŒã·ã¹ãã ãªã©ïŒããéå§ãããåŸè ã®ãªãœãŒã¹ã䜿çšããªãããšãå¿ èŠãªå ŽåããããŸãã ãŸãããã®é¢æ°ã¯OSã®èµ·åæã«ã¢ããªã±ãŒã·ã§ã³ãèµ·åããã®ã«äŸ¿å©ã§ããããŠãŒã¶ãŒã®ç¶æ ã«äŸåããŸããã POCOã§ãµãŒãã¹ãŸãã¯ããŒã¢ã³ãå®è£ ãããšãçµå±ã¯Poco :: Util :: ServerApplicationããç¶æ¿ããããšã«ãªããŸãã
ãµãŒããŒã®ããžãã¯ãšãªãã¿ã¹ã¯ã®ã¯ã©ã¹ãå®è£ ããŸããããšãã°ãæ¯ç§ãããã°ã©ã ãã©ãã ãåäœãããããã°ã«æžã蟌ã¿ãŸãã
class myServerTask: public Task { public: myServerTask(): Task("MyTask") // "MyTask" { } // void runTask() { Application& app = Application::instance(); while (!isCancelled()) { // sleep(1000); // Application::instance().logger().information (" " + DateTimeFormatter::format(app.uptime())); } } };
次ã«ããµãŒããŒãçŽæ¥å®è£ ããŸãã
class myServer: public ServerApplication { protected: void initialize(Application& self) { // loadConfiguration(); // ServerApplication ServerApplication::initialize(self); // logger().setChannel(AutoPtr<FileChannel>(new FileChannel("C:\\log.log"))); // logger().information(""); } void uninitialize() { logger().information(""); // ServerApplication ServerApplication::uninitialize(); } int main(const std::vector<std::string>& args) { if (!config().getBool("application.runAsDaemon") && !config().getBool("application.runAsService")) { // // cout << " , " << endl; } else { // // // TaskManager tm; // tm.start(new myServerTask); // waitForTerminationRequest(); // tm.cancelAll(); tm.joinAll(); } // return Application::EXIT_OK; } }; // POCO_SERVER_MAIN(myServer)
ãã¹ãŠããµãŒãã¹ããã³ããŒã¢ã³ãæžã蟌ãŸããŸãã
次ã®ããŒã䜿çšããŠWindowsãµãŒãã¹ãã³ã³ãã€ã«ããã³ç»é²ããŸãã
- WindowsãµãŒãã¹ãç»é²ããã«ã¯ïŒ / registerService
- WindowsãµãŒãã¹ããªãã«ããã«ã¯ïŒ / unregisterService
- WindowsãµãŒãã¹ã®ååãå€æŽããã«ã¯ïŒ / displayName "Name"
ã¢ããªã±ãŒã·ã§ã³ã®éå§ãšçµäºã¯æ¬¡ã®ãšããã§ãã
- UnixããŒã¢ã³ãå®è¡ããã«ã¯ïŒ-- daemon
- WindowsãµãŒãã¹ãéå§ããã«ã¯ãã³ãã³ãã©ã€ã³ãå®è¡ããŸãïŒ net start <Application>
- killallããŒã¢ã³<ã¢ããªã±ãŒã·ã§ã³>ãå®äºããã«ã¯
- ãµãŒãã¹ãããã¹ããããå®äºããã«ã¯<ã¢ããªã±ãŒã·ã§ã³>
èšå®ãããŠã³ããŒã
æ§æã¯ã¡ãœããã«ãã£ãŠããŒããããŸãïŒ
void loadConfiguration(const std::string& path, int priority = PRIO_DEFAULT);
ãã¡ã€ã«ã¿ã€ãã¯ãæ¡åŒµåã«ãã£ãŠæ±ºãŸããŸãã
- .properties-ããããã£ãã¡ã€ã«ïŒPropertyFileConfigurationïŒ
- .ini-åæåãã¡ã€ã«ïŒIniFileConfigurationïŒ
- .xml-XMLãã¡ã€ã«ïŒXMLConfigurationïŒ
ããŒã¿ãã¢ããããŒãããããšããããã䜿çšã§ããŸãã POCOã§ã¯ãããŒã¿ã¢ãã«ã¯ããªãŒã§ãããåèŠçŽ ãžã®ã¢ã¯ã»ã¹ã¯æååã§æå®ãããŸãã
ããšãã°ãXMLïŒ
<?xml version="1.0" encoding="UTF-8"?> <recipe name="" preptime="5" cooktime="180"> <title> </title> <composition> <ingredient amount="3" unit=""></ingredient> <ingredient amount="0.25" unit=""></ingredient> <ingredient amount="1.5" unit=""> </ingredient> <ingredient amount="1" unit=" "></ingredient> </composition> <instructions> <step> .</step> <step> .</step> <!-- <step> .</step> - ... --> <step> , .</step> </instructions> </recipe>
次ã®ããã«åºè·ããŸãã
void initialize(Application& self) { ofstream file("out.txt"); cout << "" << endl; loadConfiguration("a:\\conf.xml"); file << " : " << config().getString("title") << endl << " : " << config().getString("composition.ingredient[0]") << " : " << config().getString("composition.ingredient[0][@amount]") << " " << config().getString("composition.ingredient[0][@unit]") << endl << config().getString("composition.ingredient[1]") << " : " << config().getString("composition.ingredient[1][@amount]") << " " << config().getString("composition.ingredient[1][@unit]") << endl << config().getString("composition.ingredient[2]") << " : " << config().getString("composition.ingredient[2][@amount]") << " " << config().getString("composition.ingredient[2][@unit]") << endl << config().getString("composition.ingredient[3]") << " : " << config().getString("composition.ingredient[3][@amount]") << " " << config().getString("composition.ingredient[3][@unit]") << endl << " : " << endl << config().getString("instructions.step[0]") << endl << config().getString("instructions.step[1]") << endl << config().getString("instructions.step[2]") << endl; int timeToCook = config().getInt("[@cooktime]"); file << " : " << timeToCook << endl; file.close(); }
çµæã¯æ¬¡ã®ãšããã§ãã
æçïŒç°¡åãªãã³
ãã®ããã«å¿ èŠãªãã®ïŒå°éºŠç²ïŒ3ã«ãã
é µæ¯ïŒ0.25ã°ã©ã
æž©æ°ŽïŒ1.5ã«ãã
å¡©ïŒå°ãã1
次ã®æé ãå®è¡ããŸãã
ãã¹ãŠã®ææãæ··åãã培åºçã«ãããŸãã
åžã§èŠããæããéšå±ã§1æéæŸçœ®ããŸãã
ããäžåºŠããã倩æ¿ã«ä¹ããŠãªãŒãã³ã«å ¥ããŸãã
æçæéïŒ180
åæ§ã«ã解æããŠINIãäœæã§ããŸãã ãããã£ãŠããcategory.keyããšãã圢åŒã®èå¥åãåžžã«ååšããŸãã
äŸãã°
;INI-File [Group] ValueText = "hello world" IntValue = 123
次ã®ããã«åºè·ããŸãã
std::string text = config().getString("Group.ValueText"); // text == "Hello world" int value = config().getInt("Group.IntValue"); // value == 123
.Propertyãã¡ã€ã«ã«ã¯ããã¡ã€ã«å ã®å€æ°èªäœã®ååããããŸã
; Javaããããã£ãã¡ã€ã«
Value.Text = "hello world"
Int.Value = 123
次ã®ããã«åºè·ããŸãã
std::string text = config().getString("Value.Text"); // text == "Hello world" int value = config().getInt("Int.Value"); // value == 123
ãã®ã³ã°ããŒã«
ãã®ã³ã°ããŒã«ã¯ã4ã€ã®äž»èŠãªéšåã§æ§æãããŠããŸãã
- ãã¬ãŒ
- ãã£ã³ãã«
- ããŒã¿ã¹ãã¬ãŒãžãªããžã§ã¯ãïŒãã¡ã€ã«ãããŒã¿ããŒã¹ïŒ
- ãã©ãŒããã¿
ãã¬ãŒã¯ãã¢ããªã±ãŒã·ã§ã³ããã°ã«ããŒã¿ãéä¿¡ããããã«ã¢ã¯ã»ã¹ãããã§ãŒã³å ã®ãªã³ã¯ã§ãã ãã®ã³ã°ããã»ã¹ã®åäœã¯ã¡ãã»ãŒãžã§ãã
ã¡ãã»ãŒãžã¯æ¬¡ã®ãã®ãæã€ãªããžã§ã¯ãã§ãïŒ
- ããŒã¿ãœãŒã¹ïŒäºåã«éžæãããããã¹ãå€ïŒ
- ããŒã¿-ã€ãã³ãã«é¢ããæçšãªæ å ±ãå«ãæåå
- ã¿ã€ã ã¹ã¿ã³ã
- ã¡ãã»ãŒãžã®åªå 床
- ããã»ã¹èå¥åïŒPIDïŒãšãããŒïŒTIDïŒ
- ããã€ãã®ãªãã·ã§ã³ã®ãã©ã¡ãŒã¿ãŒ
åªå é äœã¯æ¬¡ã®é åºã§èšå®ãããŸãïŒäœããé«ãžïŒã
- ãã¬ãŒã¹æ å ±ïŒãã¬ãŒã¹ïŒ
- ãããã°æ å ±ïŒãããã°ïŒ
- æè¡æ å ±
- ãªãã€ã³ããŒïŒéç¥ïŒ
- èŠå
- ãšã©ãŒ
- é倧ãªãšã©ãŒ
- èŽåœçãªãšã©ãŒ
ããŒã¿ã¯æååã§è¡šãããŸãããä»ã®ããŒã¿ããšã³ã³ãŒãããããšãã§ããŸãã ãã€ã¯ãç§ã®ç²ŸåºŠã§ã¿ã€ã ã¹ã¿ã³ããäœæãããŸãã
ãã£ãã« -ãã¬ãŒãšããŒã¿ã¹ãã¬ãŒãžãªããžã§ã¯ãéã®ãªã³ã¯ã
ããã€ãã®åºæ¬çãªãã£ãã«ããããŸãã
- ConsoleChannel-ãæ³åã®ãšãããããã¯æšæºåºåã¹ããªãŒã STDOUTã«ããŒã¿ãåºåãããã£ãã«ã§ã
- WindowsConsoleChannel-std :: clogã«ããŒã¿ãåºåããWindowsåºæã®ã³ã³ãœãŒã«ãã£ãã«
- NullChannel-ãã¹ãŠã®ããŒã¿ãæåŠããŸã
- SimpleFileChannel-ãã¡ã€ã«ãžã®åºåçšã®ã·ã³ãã«ãªãã£ãã«ã§ãæ°ããã¡ãã»ãŒãžãæ°ããè¡ã«è¿œå ãããŸãã ã¹ããããããæ倧ãã¡ã€ã«ãµã€ãºããããŸãã ãã©ã€ããªãæ倧ãµã€ãºãè¶ ããå Žåãã»ã«ã³ããªãã¡ã€ã«ã䜿çšããŠããŒã¿ãä¿åã§ããŸãã
- FileChannelã¯ãå šèŒªé§åã®ãã¡ã€ã«ãã£ãã«ã§ãã ã¢ãŒã«ã€ããã¿ã€ã ãŸãŒã³ãå§çž®ãæ倧ãã°æå¹æéããµããŒãããŸãã
- EventLogChannelã¯ãWindowsã·ã¹ãã ã€ãã³ããã°ã«ã¡ãã»ãŒãžãéä¿¡ã§ããããã«ããWindowsåºæã®ããŒã¿ãã£ãã«ã§ãã
- SyslogChannel-syslogããŒã¢ã³ãµãŒããŒã«ã¡ãã»ãŒãžãéä¿¡ãããã£ãã«ã
- AsyncChannel-ä»»æã®ãã£ãã«ã«éåæã§ã¡ãã»ãŒãžãéä¿¡ã§ããããã«ããããªããžã
- SplitterChannel-1ã€ã®ã¡ãã»ãŒãžãè€æ°ã®ãã£ãã«ã«éä¿¡ã§ãããã£ãã«
ãã¬ãŒã®äœ¿çšäŸïŒ
// AutoPtr<ConsoleChannel> console(new ConsoleChannel); // AutoPtr<PatternFormatter> formater(new PatternFormatter); formater->setProperty("pattern", "%Y-%m-%d %H:%M:%S %s: %t"); // AutoPtr<FormattingChannel> formatingChannel(new FormattingChannel(formater, console)); // Logger::root().setChannel(formatingChannel); // Logger::get("Console").information(" "); // AutoPtr<FormattingChannel> file(new FormattingChannel(formater, AutoPtr<FileChannel>(new FileChannel("A:\\123.txt")))); // Logger::create("File", file); // Logger::get("File").fatal("I want to play a game. "); // AutoPtr<SplitterChannel> splitter(new SplitterChannel); // splitter->addChannel(file); splitter->addChannel(console); // Logger::create("AllChannel", file); // Logger::get("AllChannel").fatal(" "); // AutoPtr<EventLogChannel> event(new EventLogChannel); // Logger::create("Event", event); // ( Windows) Logger::get("Event").fatal(" ");
ã¯ã©ã¹ãåå¥ã®ã¢ãžã¥ãŒã«ã«ãã
POCOã®åºæ¬æŠå¿µã¯ããã¹ãŠã®ã³ã¹ãã§ã®ã¢ãžã¥ãŒã«æ§ã§ãããåçã©ã€ãã©ãªããã®èªã¿èŸŒã¿ãå¯èœã«ããåªããããŒã«ã§ããClassLoaderã䜿çšãããšãå®è¡æã«ãã®ãããªã¢ãžã¥ãŒã«æ§ãå®çŸã§ããŸãã
é åããœãŒãããããã®æœè±¡ã¯ã©ã¹ãå®è£ ããŸãã
ãšã¯ã¹ããŒãããã«ã¯ãããã©ã«ãã®ã³ã³ã¹ãã©ã¯ã¿ãšä»®æ³ãã¹ãã©ã¯ã¿ãåºæ¬ã¯ã©ã¹ã«å®è£ ããçŽç²ãªä»®æ³ã¡ãœããvirtual string nameïŒïŒconst = 0;ãäœæããå¿ èŠããããŸã åŸç¶ã¯ã©ã¹ã«å®è£ ããŸãã
// sort.h class ABaseSort { protected: vector<int> array; // public: ABaseSort () {} // - virtual ~ABaseSort() {} // virtual string name() const = 0; // name , // virtual void sort() = 0; // - void loadVector(vector<int>& lArray) { array.assign(lArray.begin(), lArray.end()); } vector<int> getArray() { return array; } //Xor-swap static void swap(int &A, int &B) { A ^= B ^= A ^= B; } };
次ã«ãããã«ã¡ãœãããšæšæºã®STLã¡ãœããïŒstable_sortïŒã®2ã€ã®äžŠã¹æ¿ãã¯ã©ã¹ãäœæããŸãã
// // sort.cpp #include "sort.h" class bubbleSort : public ABaseSort { public: // string name() const { return "Bubble Sort"; } // void sort() { size_t size = array.size(); for (int i=0; i<size-1; ++i) for (int j=i; j<size; ++j) if (array[i] > array[j]) swap(array[i],array[j]); } }; // STL (std::stable_sort) class stableSort : public ABaseSort { public: // string name() const { return "Stable Sort"; } // void sort() { stable_sort(array.begin(), array.end()); } };
ãšã¯ã¹ããŒããªãã·ã§ã³ãè¿œå ããŸã
POCO_BEGIN_MANIFEST(ABaseSort) // POCO_EXPORT_CLASS(bubbleSort) // POCO_EXPORT_CLASS(stableSort) // stable_sort POCO_END_MANIFEST
ãããžã§ã¯ããåçã©ã€ãã©ãªãšããŠã³ã³ãã€ã«ããŸãã
ããã§ã¯ãã¯ã©ã¹ã䜿çšããŸãããã
// logic.cpp #include "sort.h" // ABaseSort Poco::ClassLoader<ABaseSort> loader; loader.loadLibrary("myImportedFile.dll"); // if (loader.isLibraryLoaded("myImportedFile.dll")) { // cout << " : " << endl; for (auto it = loader.begin(); it != loader.end(); ++it) { cout << " '" << it->first << "': " << endl; for (auto jt = it->second->begin(); jt != it->second->end(); ++jt) { cout << jt->name() << endl; } } // int arr[13] = {32,41,23,20,52,67,52,34,2,5,23,52,3}; vector<int> A (arr,arr+13); // if (ABaseSort *sort = loader.create("bubbleSort")) { // sort->loadVector(A); // sort->sort(); // auto vect = sort->getArray(); // for (auto it = vect.begin(); it != vect.end(); ++it) cout << *it << " "; cout << endl; // loader.classFor("bubbleSort").autoDelete(sort); } // stableSort if (ABaseSort *sort = loader.create("stableSort")) { sort->loadVector(A); sort->sort(); auto vect = sort->getArray(); for (auto it = vect.begin(); it != vect.end(); ++it) cout << *it << " "; cout << endl; loader.classFor("stableSort").autoDelete(sort); } }
ãããã£ãŠãå®å šã«åã³ã³ãã€ã«ããã«ããã°ã©ã ã®ããžãã¯ãå€æŽã§ããŸãã åã ã®ã¢ãžã¥ãŒã«ãåã³ã³ãã€ã«ããŠãããã°ã©ã ã«ããã£ãŒããããã ãã§ååã§ãã
ãããã«
äžèšã®äŸã¯ãPOCOã©ã€ãã©ãªã䜿çšããéçºã®ããã€ãã®æ©èœã瀺ããŠããŸãã POCOã§ã¢ããªã±ãŒã·ã§ã³ãŸãã¯ãµãŒãã¹ãäœæããã®ã¯æéã®ãããä»äºã§ã¯ãªãããšã«æ°ä»ããããããŸããã å°æ¥ãXMLãZIPãDataãNetã¢ãžã¥ãŒã«ã«ã€ããŠè©³ããã話ãããããšæããŸãã ããã«è©³ããã¯ãPOCOã§ã®é«æ§èœãµãŒããŒã®äœæã«çŠç¹ãåœãŠãŸãã NotificationsïŒEventsã·ã¹ãã ããã£ãã·ã³ã°ã·ã¹ãã ãæå·åã¢ãžã¥ãŒã«ãå解ããŸãã
èšäºãèªãã§ãããŠããããšãã åççãªæ¹å€ãšææ¡ãæè¿ããŸãã