summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_nodeowner.h
blob: 329b1e328416ed668d186dbaa4c57fdb09b1bb1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2018 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#ifndef XFA_FXFA_PARSER_CXFA_NODEOWNER_H_
#define XFA_FXFA_PARSER_CXFA_NODEOWNER_H_

#include <memory>
#include <set>

class CXFA_Node;

class CXFA_NodeOwner {
 public:
  virtual ~CXFA_NodeOwner();

  void ReleaseXMLNodesIfNeeded();

  CXFA_Node* AddOwnedNode(std::unique_ptr<CXFA_Node> node);
  void FreeOwnedNode(CXFA_Node* node);

 protected:
  CXFA_NodeOwner();

  std::set<std::unique_ptr<CXFA_Node>> nodes_;
};

#endif  // XFA_FXFA_PARSER_CXFA_NODEOWNER_H_