Esempio n. 1
0
bool StreamMonitor::Init(Variant &configuration) {
    if (configuration.HasKeyChain(V_STRING, false, 1,
                                  "monitorPath")) {
        _monitorPath = (string) configuration.GetValue("monitorPath", false);
    }
    if (configuration.HasKeyChain(V_STRING, false, 1,
                                  "speedPath")) {
        _speedPath = (string) configuration.GetValue("speedPath", false);
    }
    return OpenMonitorFile() && OpenSpeedFile();
}
Esempio n. 2
0
Owned<void> DynamicMove(Variant value)
{
	if (!value.GetType().is_move_constructible())
	{
		return nullptr;
	}

	// Create constructor
	auto constructor = [&](byte* location)
	{
		value.GetType().get_move_constructor()(location, value.GetValue());
	};

	// Construct object
	return AllocateDynamicNew(value.GetType(), constructor);
}