dterei / cpp-starter

Starter scaffolding for a C++ project using autotools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project

This is a project.

Cache

Caching library:

  • key-value pairs.

  • set(key, value) bool

  • get(key) *value

  • delete(key) bool

  • deleteAll() void

  • all() []key-value -- iterators

With configurable eviction policy. For example:

  • Least-recently-used.
  • FIFO (insertion order).

When to evict:

  • When number of keys exceeds a configurable maximum.

Use-Cases

Without caching:

func handleRequest(conn, req):
  resp := slow_build_response_path(req)
  write(conn, resp)

With caching:

var cache Cache

func handleRequest(conn, req):
  key := derive_key(req)
  resp := cache.get(key)
  if resp == nil {
    resp := slow_build_response_path(req)
    cache.set(key, resp)
  }
  write(conn, resp)

Building

This project uses automake and autoconf for its build system. To build:

./autogen.sh
./configure
make

To package up the binaries, use:

Authors

This library is written and maintained by David Terei dterei@cs.stanford.edu.

Licensing

This library is BSD-licensed.

About

Starter scaffolding for a C++ project using autotools

License:Other


Languages

Language:M4 62.7%Language:C++ 19.3%Language:Makefile 16.8%Language:Shell 1.2%