File: sp.h

package info (click to toggle)
pybindgen 0.20.0%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,932 kB
  • sloc: python: 15,981; cpp: 1,889; ansic: 617; makefile: 86; sh: 4
file content (36 lines) | stat: -rw-r--r-- 809 bytes parent folder | download | duplicates (6)
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
31
32
33
34
35
36
// -*- Mode: C++; c-file-style: "stroustrup"; indent-tabs-mode:nil; -*-
#ifndef   	SP_H_
# define   	SP_H_

#include <string>
#include <iostream>
#include <memory>


class Foo
{
    std::string m_datum;
public:

    Foo () : m_datum ("") {
        std::cout << "Created empty foo" << std::endl;
    }

    Foo (std::string const &datum) : m_datum (datum) {
        std::cout << "Created foo with datum " << datum << std::endl;
    }

    const std::string get_datum () const { return m_datum; }
    
    void set_datum (std::string const &datum) { m_datum = datum; }

    virtual ~Foo() {
        std::cout << "Destroyed foo with datum " << m_datum << std::endl;
    }

};

void function_that_takes_foo (std::shared_ptr<Foo> foo);
std::shared_ptr<Foo> function_that_returns_foo ();

#endif 	    /* !FOO_H_ */