CodeLink.hh 1.01 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// (C) Copyright 2016 by Autodesk, Inc.
//
// The information contained herein is confidential, proprietary
// to Autodesk,  Inc.,  and considered a trade secret as defined
// in section 499C of the penal code of the State of California.
// Use of  this information  by  anyone  other  than  authorized
// employees of Autodesk, Inc.  is granted  only under a written
// non-disclosure agreement,  expressly  prescribing  the  scope
// and manner of such use.

#ifndef BASE_CODELINK_HH_INCLUDED
#define BASE_CODELINK_HH_INCLUDED

namespace Base {

16
17
class IOutputStream;

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//! Convenient wrapper around a preprocessor source code link
struct CodeLink
{
  CodeLink(
    const char* _fnct,
    const char* _file,
    const int _line
    ) 
    : fnct(_fnct), file(_file), line(_line) 
  {}
  
  const char* fnct;
  const char* file;
  int line;
};

34
IOutputStream& operator<<(IOutputStream& _os, const CodeLink& _lnk);
35
36
37
38
39
40

}//namespace Base

#define BASE_CODELINK Base::CodeLink(__FUNCTION__, __FILE__, __LINE__)

#endif//BASE_CODELINK_HH_INCLUDED