| 210 | }; |
| 211 | |
| 212 | void test_constructor(void) |
| 213 | { |
| 214 | SpecificFactory<G> fc; |
| 215 | |
| 216 | fc.RegisterConstructor<int>("D"); |
| 217 | fc.RegisterConstructor<int, int, int>("D"); |
| 218 | fc.RegisterConstructor<const char*>("D"); |
| 219 | fc.RegisterConstructor<const std::string&>("D"); |
| 220 | fc.RegisterConstructor<std::string&&>("D"); |
| 221 | fc.RegisterConstructor("D"); |
| 222 | |
| 223 | std::cout << "all register constructors for D \n"; |
| 224 | |
| 225 | std::vector<std::string> info = fc.CreatorInfo("D"); |
| 226 | |
| 227 | for(auto str : info) |
| 228 | { |
| 229 | std::cout << str << std::endl; |
| 230 | } |
| 231 | |
| 232 | fc.Create("D"); |
| 233 | |
| 234 | fc.Create("D", 1000); |
| 235 | |
| 236 | std::string str = "I'm string"; |
| 237 | |
| 238 | fc.Create<const char*>("D", "i'm here"); |
| 239 | fc.Create<std::string&&>("D", std::move(str)); |
| 240 | fc.Create<std::string&&>("D", "who are you"); |
| 241 | fc.Create<const std::string&>("D", "hello, world"); |
| 242 | |
| 243 | fc.Create("D", 1, 0, 1); |
| 244 | } |
| 245 | |
| 246 | void test_interface() |
| 247 | { |
no test coverage detected