本文整理汇总了C++中modules::Library类的典型用法代码示例。如果您正苦于以下问题:C++ Library类的具体用法?C++ Library怎么用?C++ Library使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Library类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getModules
static Modules getModules(const string& libraryName, const string& moduleName)
{
Modules modules;
Modules::Library* library = modules.add_libraries();
library->set_file(os::libraries::expandName(libraryName));
library->add_modules(moduleName);
return modules;
}
示例2: ModuleTest
ModuleTest()
: module(None())
{
Modules::Library* library = defaultModules.add_libraries();
library->set_file(path::join(
libraryDirectory,
os::libraries::expandName(DEFAULT_MODULE_LIBRARY_NAME)));
library->add_modules(DEFAULT_MODULE_NAME);
}
示例3:
// Test that loading a duplicate module fails.
TEST_F(ModuleTest, DuplicateModule)
{
// Add duplicate module.
Modules::Library* library = defaultModules.add_libraries();
library->set_name(DEFAULT_MODULE_LIBRARY_NAME);
library->add_modules(DEFAULT_MODULE_NAME);
EXPECT_ERROR(ModuleManager::load(defaultModules));
}
示例4: addAllocatorModules
// Add available Allocator modules.
static void addAllocatorModules(Modules* modules)
{
CHECK_NOTNULL(modules);
// Now add our allocator module.
Modules::Library* library = modules->add_libraries();
library->set_file(getModulePath("testallocator"));
// To add a new module from this library, create a new ModuleID enum
// and tie it with a module name.
addModule(library, TestDRFAllocator, "org_apache_mesos_TestDRFAllocator");
}
示例5: addContainerLoggerModules
// Add available ContainerLogger modules.
static void addContainerLoggerModules(Modules* modules)
{
CHECK_NOTNULL(modules);
const string libraryDirectory = path::join(
tests::flags.build_dir,
"src",
".libs");
const string sandboxLoggerPath = path::join(
libraryDirectory,
os::libraries::expandName("testcontainer_logger"));
// Add our test container logger module.
Modules::Library* library = modules->add_libraries();
library->set_file(sandboxLoggerPath);
// To add a new module from this library, create a new ModuleID enum
// and tie it with a module name.
addModule(library,
TestSandboxContainerLogger,
"org_apache_mesos_TestSandboxContainerLogger");
const string logrotateLoggerPath = path::join(
libraryDirectory,
os::libraries::expandName("logrotate_container_logger"));
// Add the second container logger module.
library = modules->add_libraries();
library->set_file(logrotateLoggerPath);
addModule(library,
LogrotateContainerLogger,
"org_apache_mesos_LogrotateContainerLogger");
// Pass in the directory for the binary test sources.
Modules::Library::Module* module = library->mutable_modules(0);
mesos::Parameter* moduleParameter = module->add_parameters();
moduleParameter->set_key("launcher_dir");
moduleParameter->set_value(path::join(tests::flags.build_dir, "src"));
// Set the size and number of log files to keep.
moduleParameter = module->add_parameters();
moduleParameter->set_key("max_stdout_size");
moduleParameter->set_value(stringify(Megabytes(2)));
// NOTE: This is a 'logrotate' configuration option.
// It means to "rotate" a file 4 times before removal.
moduleParameter = module->add_parameters();
moduleParameter->set_key("logrotate_stdout_options");
moduleParameter->set_value("rotate 4");
}
示例6: addIsolatorModules
// Add available Isolator modules.
static void addIsolatorModules(Modules* modules)
{
CHECK_NOTNULL(modules);
// Now add our test CPU and Memory isolator modules.
Modules::Library* library = modules->add_libraries();
library->set_file(getModulePath("testisolator"));
// To add a new module from this library, create a new ModuleID enum
// and tie it with a module name.
addModule(library, TestCpuIsolator, "org_apache_mesos_TestCpuIsolator");
addModule(library, TestMemIsolator, "org_apache_mesos_TestMemIsolator");
}
示例7: addAuthenticationModules
// Add available Authentication modules.
static void addAuthenticationModules(Modules* modules)
{
CHECK_NOTNULL(modules);
// Now add our test authentication modules.
Modules::Library* library = modules->add_libraries();
library->set_file(getModulePath("testauthentication"));
// To add a new module from this library, create a new ModuleID enum
// and tie it with a module name.
addModule(library,
TestCRAMMD5Authenticatee,
"org_apache_mesos_TestCRAMMD5Authenticatee");
addModule(library,
TestCRAMMD5Authenticator,
"org_apache_mesos_TestCRAMMD5Authenticator");
}
示例8: addAllocatorModules
// Add available Allocator modules.
static void addAllocatorModules(Modules* modules)
{
CHECK_NOTNULL(modules);
const string libraryPath = path::join(
tests::flags.build_dir,
"src",
".libs",
os::libraries::expandName("testallocator"));
// Now add our allocator module.
Modules::Library* library = modules->add_libraries();
library->set_file(libraryPath);
// To add a new module from this library, create a new ModuleID enum
// and tie it with a module name.
addModule(library, TestDRFAllocator, "org_apache_mesos_TestDRFAllocator");
}