??????include ?? src???£????Щ?????????MongoSessionFactory??MongoSession???????????????MongoDB server???????ReplicaSet ?? Single server)
???????????????????ο?build.lsp???
#!/usr/bin/newlisp
(if (file? "db.so")
(delete-file "db.so"))
(if (directory? "objects")
(exec "rm -rf objects"))
(make-dir "objects")
(exec "c++ -g -fPIC -std=c++11 -I./include  -Wall -o ./objects/mongo_session_factory.cc.o -c ./src/mongo_session_factory.cc")
(exec "c++ -g -fPIC -std=c++11 -I./include  -Wall -o ./objects/mongo_session.cc.o -c ./src/mongo_session.cc")
(exec "c++ -g -fPIC -std=c++11 -I./include  -Wall -o ./objects/db.cc.o -c ./src/db.cc")
(exec "c++ -g -fPIC -std=c++11 ./objects/mongo_session_factory.cc.o ./objects/mongo_session.cc.o ./objects/db.cc.o -shared -o db.so -rdynamic -lpthread -lmongoclient -lboost_system -lboost_thread -lboost_filesystem")
(exit)
????????????д???check.lsp??????????db.so??
#!/usr/bin/newlisp
(set 'db-path "/path/to/your/db.so")
(import db-path "Init")
(import db-path "CheckOnline")
(Init "localhost:27017")
(CheckOnline)
(exit)
??????????????????????