本文整理汇总了C++中modules::Library::mutable_modules方法的典型用法代码示例。如果您正苦于以下问题:C++ Library::mutable_modules方法的具体用法?C++ Library::mutable_modules怎么用?C++ Library::mutable_modules使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类modules::Library
的用法示例。
在下文中一共展示了Library::mutable_modules方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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");
}