1 /******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
12 ******************************************************************************/
13 #include "LoggerPlugin.hh"
14 #include "ILoggerPlugin.hh"
19 void LoggerPlugin::load()
21 if (this->filename_
) {
22 // Dynamic plug-in requires dynamic runtime. Panic.
23 TTCN_Logger::fatal_error("Static runtime cannot load plugins");
25 // Static plug-in. We simply instantiate the class without any `dl*()'.
26 assert(this->create_
);
27 this->ref_
= this->create_();
31 this->is_log2str_capable_
= this->ref_
->is_log2str_capable();
34 // Completely destroy the logger plug-in and make it useless. However,
35 // reloading is possible. This should be called before the logger is
37 void LoggerPlugin::unload()
39 if (!this->ref_
) return;
41 if (this->filename_
) {
42 // This cannot happen.
43 TTCN_Logger::fatal_error("Static runtime cannot have plugins");
45 // For static plug-ins, it's simple.
This page took 0.031236 seconds and 5 git commands to generate.