~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/current_session.h

mergeĀ lp:~hingo/drizzle/drizzle-auth_ldap-fix-and-docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
18
18
 */
19
19
 
20
20
 
21
 
#ifndef DRIZZLED_CURRENT_SESSION_H
22
 
#define DRIZZLED_CURRENT_SESSION_H
 
21
#pragma once
23
22
 
24
23
#include <pthread.h>
25
24
#include <boost/thread/tss.hpp>
26
 
 
27
 
namespace drizzled
28
 
{
29
 
 
30
 
class Session;
31
 
 
32
 
namespace memory { class Root; }
33
 
 
34
 
Session *_current_session(void);
 
25
#include <drizzled/common_fwd.h>
 
26
#include <drizzled/visibility.h>
 
27
 
 
28
namespace drizzled {
 
29
 
 
30
DRIZZLED_API Session *_current_session();
35
31
#define current_session ::drizzled::_current_session()
36
 
memory::Root *current_mem_root(void);
37
 
 
38
 
typedef boost::thread_specific_ptr<Session> MySessionVar;
39
 
typedef boost::thread_specific_ptr<memory::Root *> MyMemoryRootVar;
40
 
 
41
 
MySessionVar &currentSession(void);
42
 
MyMemoryRootVar &currentMemRoot(void);
 
32
memory::Root *current_mem_root();
 
33
 
 
34
void setCurrentSession(Session*);
 
35
void setCurrentMemRoot(memory::Root*);
43
36
 
44
37
} /* namespace drizzled */
45
 
 
46
 
#endif /* DRIZZLED_CURRENT_SESSION_H */