0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
FileHandleCallback.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 3
9  * of the License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
22 #ifndef HYPERSPACE_FILEHANDLECALLBACK_H
23 #define HYPERSPACE_FILEHANDLECALLBACK_H
24 
26 
27 namespace Hyperspace {
28 
30  public:
31  FileHandleCallback(uint32_t event_mask) : HandleCallback(event_mask) { }
32  virtual void attr_set(const std::string &name) {
33  std::cout << "ATTR SET " << name << std::endl;
34  }
35  virtual void attr_del(const std::string &name) {
36  std::cout << "ATTR DEL " << name << std::endl;
37  }
38  virtual void child_node_added(const std::string &name) {
39  std::cout << "CHILD NODE ADDED " << name << std::endl;
40  }
41  virtual void child_node_removed(const std::string &name) {
42  std::cout << "CHILD NODE REMOVED " << name << std::endl;
43  }
44  virtual void lock_acquired(uint32_t mode) {
45  if (mode == LOCK_MODE_SHARED)
46  std::cout << "LOCK ACQUIRED shared" << std::endl;
47  else if (mode == LOCK_MODE_EXCLUSIVE)
48  std::cout << "LOCK ACQUIRED exclusive" << std::endl;
49  else
50  std::cout << "LOCK ACQUIRED " << mode << std::endl;
51  }
52  virtual void lock_released() { std::cout << "LOCK RELEASED" << std::endl; }
53  };
54 
55 }
56 
57 #endif // HYPERSPACE_FILEHANDLECALLBACK_H
virtual void lock_released()
Invoked when a lock gets released on the file associated with the registered handle.
Lock in shared mode.
Definition: LockSequencer.h:49
Hyperspace definitions
virtual void child_node_removed(const std::string &name)
Invoked when an attribute gets deleted from the file associated with the registered handle...
FileHandleCallback(uint32_t event_mask)
virtual void child_node_added(const std::string &name)
Invoked when a child node gets added to the directory associated with the registered handle...
virtual void lock_acquired(uint32_t mode)
Invoked when a lock gets acquired on the file associated with the registered handle.
virtual void attr_del(const std::string &name)
Invoked when an attribute gets deleted from the file associated with the registered handle...
Lock exclusive mode.
Definition: LockSequencer.h:51
virtual void attr_set(const std::string &name)
Invoked when an attribute gets set on the file associated with the registered handle.