component.h File Reference
#include <tnt/compident.h>
#include <tnt/sessionscope.h>

Go to the source code of this file.

Classes

class  tnt::Component

Namespaces

namespace  tnt

Macros

#define TNT_VAR(scope, type, varname, key, construct)
#define TNT_SESSION_COMPONENT_VAR(type, varname, construct)   TNT_VAR(request.getSessionScope(), type, varname, getCompident().toString() + "%" #type "%" #varname, construct)
#define TNT_SESSION_PAGE_VAR(type, varname, construct)   TNT_VAR(request.getSessionScope(), type, varname, getCompident().toString() + "%" #type "%" #varname, construct)
#define TNT_SESSION_SHARED_VAR(type, varname, construct)   TNT_VAR(request.getSessionScope(), type, varname, #type "%" #varname, construct)
#define TNT_SESSION_GLOBAL_VAR(type, varname, construct)   TNT_VAR(request.getSessionScope(), type, varname, #type "%" #varname, construct)
#define TNT_SESSION_FILE_VAR(type, varname, file, construct)   TNT_VAR(request.getSessionScope(), type, varname, #file "%" #type "%" #varname, construct)
#define TNT_SECURE_SESSION_COMPONENT_VAR(type, varname, construct)   TNT_VAR(request.getSecureSessionScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_SECURE_SESSION_PAGE_VAR(type, varname, construct)   TNT_VAR(request.getSecureSessionScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_SECURE_SESSION_SHARED_VAR(type, varname, construct)   TNT_VAR(request.getSecureSessionScope(), type, varname, #type "%" #varname, construct)
#define TNT_SECURE_SESSION_GLOBAL_VAR(type, varname, construct)   TNT_VAR(request.getSecureSessionScope(), type, varname, #type "%" #varname, construct)
#define TNT_SECURE_SESSION_FILE_VAR(type, varname, file, construct)   TNT_VAR(request.getSecureSessionScope(), type, varname, #file "%" #type "%" #varname, construct)
#define TNT_APPLICATION_COMPONENT_VAR(type, varname, construct)   TNT_VAR(request.getApplicationScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_APPLICATION_PAGE_VAR(type, varname, construct)   TNT_VAR(request.getApplicationScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_APPLICATION_SHARED_VAR(type, varname, construct)   TNT_VAR(request.getApplicationScope(), type, varname, #type "%" #varname, construct)
#define TNT_APPLICATION_GLOBAL_VAR(type, varname, construct)   TNT_VAR(request.getApplicationScope(), type, varname, #type "%" #varname, construct)
#define TNT_APPLICATION_FILE_VAR(type, varname, file, construct)   TNT_VAR(request.getApplicationScope(), type, varname, #file "%" #type "%" #varname, construct)
#define TNT_THREAD_COMPONENT_VAR(type, varname, construct)   TNT_VAR(request.getThreadScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_THREAD_PAGE_VAR(type, varname, construct)   TNT_VAR(request.getThreadScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_THREAD_SHARED_VAR(type, varname, construct)   TNT_VAR(request.getThreadScope(), type, varname, #type "%" #varname, construct)
#define TNT_THREAD_GLOBAL_VAR(type, varname, construct)   TNT_VAR(request.getThreadScope(), type, varname, #type "%" #varname, construct)
#define TNT_THREAD_FILE_VAR(type, varname, file, construct)   TNT_VAR(request.getThreadScope(), type, varname, #file "%" #type "%" #varname, construct)
#define TNT_REQUEST_COMPONENT_VAR(type, varname, construct)   TNT_VAR(request.getRequestScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_REQUEST_PAGE_VAR(type, varname, construct)   TNT_VAR(request.getRequestScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_REQUEST_SHARED_VAR(type, varname, construct)   TNT_VAR(request.getRequestScope(), type, varname, #type "%" #varname, construct)
#define TNT_REQUEST_GLOBAL_VAR(type, varname, construct)   TNT_VAR(request.getRequestScope(), type, varname, #type "%" #varname, construct)
#define TNT_REQUEST_FILE_VAR(type, varname, file, construct)   TNT_VAR(request.getRequestScope(), type, varname, #file "%" #type "%" #varname, construct)
#define TNT_PARAM(type, varname, construct)   TNT_VAR(qparam.getScope(), type, varname, #varname, construct)

Macro Definition Documentation

#define TNT_APPLICATION_COMPONENT_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getApplicationScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_APPLICATION_FILE_VAR (   type,
  varname,
  file,
  construct 
)    TNT_VAR(request.getApplicationScope(), type, varname, #file "%" #type "%" #varname, construct)
#define TNT_APPLICATION_GLOBAL_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getApplicationScope(), type, varname, #type "%" #varname, construct)
#define TNT_APPLICATION_PAGE_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getApplicationScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_APPLICATION_SHARED_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getApplicationScope(), type, varname, #type "%" #varname, construct)
#define TNT_PARAM (   type,
  varname,
  construct 
)    TNT_VAR(qparam.getScope(), type, varname, #varname, construct)
#define TNT_REQUEST_COMPONENT_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getRequestScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_REQUEST_FILE_VAR (   type,
  varname,
  file,
  construct 
)    TNT_VAR(request.getRequestScope(), type, varname, #file "%" #type "%" #varname, construct)
#define TNT_REQUEST_GLOBAL_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getRequestScope(), type, varname, #type "%" #varname, construct)
#define TNT_REQUEST_PAGE_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getRequestScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_REQUEST_SHARED_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getRequestScope(), type, varname, #type "%" #varname, construct)
#define TNT_SECURE_SESSION_COMPONENT_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getSecureSessionScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_SECURE_SESSION_FILE_VAR (   type,
  varname,
  file,
  construct 
)    TNT_VAR(request.getSecureSessionScope(), type, varname, #file "%" #type "%" #varname, construct)
#define TNT_SECURE_SESSION_GLOBAL_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getSecureSessionScope(), type, varname, #type "%" #varname, construct)
#define TNT_SECURE_SESSION_PAGE_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getSecureSessionScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_SECURE_SESSION_SHARED_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getSecureSessionScope(), type, varname, #type "%" #varname, construct)
#define TNT_SESSION_COMPONENT_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getSessionScope(), type, varname, getCompident().toString() + "%" #type "%" #varname, construct)
#define TNT_SESSION_FILE_VAR (   type,
  varname,
  file,
  construct 
)    TNT_VAR(request.getSessionScope(), type, varname, #file "%" #type "%" #varname, construct)
#define TNT_SESSION_GLOBAL_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getSessionScope(), type, varname, #type "%" #varname, construct)
#define TNT_SESSION_PAGE_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getSessionScope(), type, varname, getCompident().toString() + "%" #type "%" #varname, construct)
#define TNT_SESSION_SHARED_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getSessionScope(), type, varname, #type "%" #varname, construct)
#define TNT_THREAD_COMPONENT_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getThreadScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_THREAD_FILE_VAR (   type,
  varname,
  file,
  construct 
)    TNT_VAR(request.getThreadScope(), type, varname, #file "%" #type "%" #varname, construct)
#define TNT_THREAD_GLOBAL_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getThreadScope(), type, varname, #type "%" #varname, construct)
#define TNT_THREAD_PAGE_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getThreadScope(), type, varname, getCompident().toString() + ":" #type "%" #varname, construct)
#define TNT_THREAD_SHARED_VAR (   type,
  varname,
  construct 
)    TNT_VAR(request.getThreadScope(), type, varname, #type "%" #varname, construct)
#define TNT_VAR (   scope,
  type,
  varname,
  key,
  construct 
)
Value:
type* varname##_pointer; \
{ \
const std::string varname##_scopekey = key; \
tnt::Scope& _scope = scope; \
varname##_pointer = _scope.get< type >(varname##_scopekey); \
if ( ! varname##_pointer ) \
_scope.put< type >(varname##_scopekey, \
varname##_pointer = new type construct); \
} \
type& varname = *varname##_pointer;