File: main.cpp

package info (click to toggle)
libclaw 1.7.4-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,080 kB
  • sloc: cpp: 13,287; sh: 227; makefile: 8
file content (22 lines) | stat: -rw-r--r-- 608 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <claw/basic_singleton.hpp>
#include <string>
#include <iostream>

class resource_manager : public claw::concept::basic_singleton<resource_manager>
{
public:
  void print( const std::string& s ) const
  {
    std::cout << s << std::endl;
  }
}; // class resource_manager

int main()
{
  resource_manager::get_instance().print( "The instance is just allocated" );
  resource_manager::get_instance().print( "One more sentence" );
  resource_manager::get_instance().print( "The instance will be deleted at the "
                                          "end of the program" );

  return 0;
} // main()