~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/module/module.h

  • Committer: Monty Taylor
  • Date: 2010-06-20 14:27:46 UTC
  • Revision ID: mordred@inaugust.com-20100620142746-an1iu40a3g4qcokn
Undid attempt at fixing sporadic freebsd issue.

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) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2009 Sun Microsystems
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
29
29
 */
30
30
 
31
31
#include <cassert>
32
 
#include <vector>
33
 
#include <boost/program_options.hpp>
34
 
 
35
 
#include <drizzled/module/manifest.h>
36
 
#include <drizzled/module/registry.h>
37
 
 
 
32
 
 
33
#include "drizzled/module/manifest.h"
38
34
 
39
35
namespace drizzled
40
36
{
41
 
class set_var;
 
37
class sys_var;
42
38
 
43
39
void module_shutdown(module::Registry &registry);
44
40
 
46
42
{
47
43
 
48
44
class Library;
49
 
class VertexHandle;
50
45
 
51
46
/* A plugin module */
52
47
class Module
53
48
{
54
 
public:
55
 
  typedef std::vector<sys_var *> Variables;
56
 
  typedef std::vector<std::string> Depends;
57
 
 
58
 
private:
59
49
  const std::string name;
60
50
  const Manifest *manifest;
61
 
  VertexHandle *vertex_;
62
 
 
63
51
public:
64
52
  Library *plugin_dl;
65
53
  bool isInited;
66
 
  Variables system_vars;         /* server variables for this plugin */
67
 
  Variables sys_vars;
68
 
  Depends depends_;
69
 
 
70
 
  Module(const Manifest *manifest_arg,
71
 
         Library *library_arg);
72
 
 
73
 
  ~Module();
74
 
 
 
54
  sys_var *system_vars;         /* server variables for this plugin */
 
55
  Module(const Manifest *manifest_arg, Library *library_arg)
 
56
    : name(manifest_arg->name), manifest(manifest_arg), plugin_dl(library_arg),
 
57
      isInited(false),
 
58
      system_vars(NULL)
 
59
  {
 
60
    assert(manifest != NULL);
 
61
  }
 
62
      
 
63
  Module(const Manifest *manifest_arg)
 
64
    : name(manifest_arg->name), manifest(manifest_arg), plugin_dl(NULL),
 
65
      isInited(false),
 
66
      system_vars(NULL)
 
67
  {
 
68
    assert(manifest != NULL);
 
69
  }
 
70
      
75
71
  const std::string& getName() const
76
72
  {
77
73
    return name;
81
77
  {
82
78
    return *manifest;
83
79
  }
84
 
 
85
 
  void addMySysVar(sys_var *var)
86
 
  {
87
 
    sys_vars.push_back(var);
88
 
    addSysVar(var);
89
 
  }
90
 
 
91
 
  void addSysVar(sys_var *var)
92
 
  {
93
 
    system_vars.push_back(var);
94
 
  }
95
 
 
96
 
  Variables &getSysVars()
97
 
  {
98
 
    return system_vars;
99
 
  }
100
 
 
101
 
  const Depends &getDepends() const
102
 
  {
103
 
    return depends_;
104
 
  }
105
 
 
106
 
  void setVertexHandle(VertexHandle *vertex)
107
 
  {
108
 
    vertex_= vertex;
109
 
  }
110
 
 
111
 
  VertexHandle *getVertexHandle()
112
 
  {
113
 
    return vertex_;
114
 
  }
115
80
};
116
81
 
117
82
} /* namespace module */