Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // C++ -> C interface
- extern "C" void BioGears_Logger_LogToConsole(BioGears::Logger* _OBJ, bool b)
- {
- _OBJ->LogToConsole(b);
- }
- extern "C" void BioGears_Logger_ResetLogFile(BioGears::Logger* _OBJ, const std::string & logFilename)
- {
- _OBJ->ResetLogFile(logFilename);
- }
- extern "C" void BioGears_Logger_SetLogLevel(BioGears::Logger* _OBJ, int priority)
- {
- _OBJ->SetLogLevel(priority);
- }
- extern "C" int BioGears_Logger_GetLogLevel(BioGears::Logger* _OBJ)
- {
- return _OBJ->GetLogLevel();
- }
- extern "C" void BioGears_Logger_SetLogTime(BioGears::Logger* _OBJ, const SEScalarTime * time)
- {
- _OBJ->SetLogTime(time);
- }
- extern "C" void BioGears_Logger_SetForward(BioGears::Logger* _OBJ, LoggerForward * forward)
- {
- _OBJ->SetForward(forward);
- }
- extern "C" bool BioGears_Logger_HasForward(BioGears::Logger* _OBJ)
- {
- return _OBJ->HasForward();
- }
- extern "C" void BioGears_Logger_Debug(BioGears::Logger* _OBJ, const std::string & msg, const std::string & origin)
- {
- _OBJ->Debug(msg, origin);
- }
- extern "C" void BioGears_Logger_Info(BioGears::Logger* _OBJ, const std::string & msg, const std::string & origin)
- {
- _OBJ->Info(msg, origin);
- }
- extern "C" void BioGears_Logger_Warning(BioGears::Logger* _OBJ, const std::string & msg, const std::string & origin)
- {
- _OBJ->Warning(msg, origin);
- }
- extern "C" void BioGears_Logger_Error(BioGears::Logger* _OBJ, const std::string & msg, const std::string & origin)
- {
- _OBJ->Error(msg, origin);
- }
- extern "C" void BioGears_Logger_Fatal(BioGears::Logger* _OBJ, const std::string & msg, const std::string & origin)
- {
- _OBJ->Fatal(msg, origin);
- }
- // - no C# P/Invoke code yet
- // C# interface:
- namespace BioGears
- {
- public class Logger
- {
- public IntPtr _cxxData;
- public void LogToConsole(bool b)
- {
- NI.BioGears_Logger_LogToConsole(_cxxData, b);
- }
- public void ResetLogFile(string logFilename)
- {
- NI.BioGears_Logger_ResetLogFile(_cxxData, logFilename);
- }
- public void SetLogLevel(int priority)
- {
- NI.BioGears_Logger_SetLogLevel(_cxxData, priority);
- }
- public int GetLogLevel()
- {
- return NI.BioGears_Logger_GetLogLevel(_cxxData);
- }
- public void SetLogTime(SEScalarTime time)
- {
- NI.BioGears_Logger_SetLogTime(_cxxData, time);
- }
- public void SetForward(LoggerForward forward)
- {
- NI.BioGears_Logger_SetForward(_cxxData, forward);
- }
- public bool HasForward()
- {
- return NI.BioGears_Logger_HasForward(_cxxData);
- }
- public void Debug(string msg, string origin)
- {
- NI.BioGears_Logger_Debug(_cxxData, msg, origin);
- }
- public void Info(string msg, string origin)
- {
- NI.BioGears_Logger_Info(_cxxData, msg, origin);
- }
- public void Warning(string msg, string origin)
- {
- NI.BioGears_Logger_Warning(_cxxData, msg, origin);
- }
- public void Error(string msg, string origin)
- {
- NI.BioGears_Logger_Error(_cxxData, msg, origin);
- }
- public void Fatal(string msg, string origin)
- {
- NI.BioGears_Logger_Fatal(_cxxData, msg, origin);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement