Crow  1.0
A C++ microframework for the web
crow::Trie Class Reference

A search tree. More...

Collaboration diagram for crow::Trie:

Classes

struct  Node
 

Public Member Functions

 Trie ()
 
bool is_empty ()
 Check whether or not the trie is empty. More...
 
void optimize ()
 
void debug_print ()
 
void validate ()
 
std::tuple< uint16_t, std::vector< uint16_t >, routing_params > find (const std::string &req_url, const Node *node=nullptr, unsigned pos=0, routing_params *params=nullptr, std::vector< uint16_t > *blueprints=nullptr) const
 
void add (const std::string &url, uint16_t rule_index, unsigned bp_prefix_length=0, uint16_t blueprint_index=INVALID_BP_ID)
 
size_t get_size ()
 
size_t get_size (Node *node)
 

Private Member Functions

void optimizeNode (Node *node)
 
void debug_node_print (Node *node, int level)
 
Nodenew_node (Node *parent)
 

Private Attributes

Node head_
 

Detailed Description

A search tree.

Constructor & Destructor Documentation

◆ Trie()

crow::Trie::Trie ( )
inline

Member Function Documentation

◆ is_empty()

bool crow::Trie::is_empty ( )
inline

Check whether or not the trie is empty.

◆ optimize()

void crow::Trie::optimize ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ optimizeNode()

void crow::Trie::optimizeNode ( Node node)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ debug_node_print()

void crow::Trie::debug_node_print ( Node node,
int  level 
)
inlineprivate
Here is the caller graph for this function:

◆ debug_print()

void crow::Trie::debug_print ( )
inline
Here is the call graph for this function:

◆ validate()

void crow::Trie::validate ( )
inline
Here is the call graph for this function:

◆ find()

std::tuple<uint16_t, std::vector<uint16_t>, routing_params> crow::Trie::find ( const std::string &  req_url,
const Node node = nullptr,
unsigned  pos = 0,
routing_params *  params = nullptr,
std::vector< uint16_t > *  blueprints = nullptr 
) const
inline

◆ add()

void crow::Trie::add ( const std::string &  url,
uint16_t  rule_index,
unsigned  bp_prefix_length = 0,
uint16_t  blueprint_index = INVALID_BP_ID 
)
inline
Here is the call graph for this function:

◆ get_size() [1/2]

size_t crow::Trie::get_size ( )
inline
Here is the caller graph for this function:

◆ get_size() [2/2]

size_t crow::Trie::get_size ( Node node)
inline
Here is the call graph for this function:

◆ new_node()

Node* crow::Trie::new_node ( Node parent)
inlineprivate
Here is the caller graph for this function:

Member Data Documentation

◆ head_

Node crow::Trie::head_
private

The documentation for this class was generated from the following file: