OpenSDN source code
t_typedef.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  * Modifications Copyright (c) Juniper Networks, Inc.
20  * Copyright Contributors to the OpenSDN project
21  */
22 
23 #ifndef T_TYPEDEF_H
24 #define T_TYPEDEF_H
25 
26 #include <string>
27 #include "t_type.h"
28 
36 class t_typedef : public t_type {
37  public:
38  t_typedef(t_program* program, t_type* type, std::string symbolic) :
39  t_type(program, symbolic),
40  type_(type),
41  symbolic_(symbolic) {}
42 
44 
45  t_type* get_type() const {
46  return type_;
47  }
48 
49  const std::string& get_symbolic() const {
50  return symbolic_;
51  }
52 
53  bool is_typedef() const {
54  return true;
55  }
56 
57  virtual std::string get_fingerprint_material() const {
59  }
60 
61  virtual void generate_fingerprint() {
63  if (!type_->has_fingerprint()) {
65  }
66  }
67 
68  private:
70  std::string symbolic_;
71 };
72 
73 #endif
Definition: t_type.h:51
virtual void generate_fingerprint()
Definition: parse.cc:13
bool has_fingerprint() const
Definition: t_type.h:104
virtual std::string get_fingerprint_material() const =0
virtual std::string get_fingerprint_material() const
Definition: t_typedef.h:57
std::string symbolic_
Definition: t_typedef.h:70
virtual void generate_fingerprint()
Definition: t_typedef.h:61
t_typedef(t_program *program, t_type *type, std::string symbolic)
Definition: t_typedef.h:38
t_type * type_
Definition: t_typedef.h:69
t_type * get_type() const
Definition: t_typedef.h:45
bool is_typedef() const
Definition: t_typedef.h:53
~t_typedef()
Definition: t_typedef.h:43
const std::string & get_symbolic() const
Definition: t_typedef.h:49
uint8_t type
Definition: load_balance.h:2