[Synopsis-changes] Synopsis/Synopsis/include/Synopsis Kit.hh,NONE,1.1 TypedList.hh,NONE,1.1
Stefan Seefeld stefan at synopsis.fresco.orgSun Jan 25 21:21:56 UTC 2004
- Previous message: [Synopsis-changes] Synopsis/Synopsis/tests/Cxx-API/Python/src Dict.cc,1.1,1.2 Interpreter.cc,1.3,1.4 List.cc,1.2,1.3 Tuple.cc,1.2,1.3
- Next message: [Synopsis-changes] Synopsis/Synopsis/include/Synopsis/AST ASTKit.hh,NONE,1.1 Declared.hh,NONE,1.1 Type.hh,NONE,1.1 TypeKit.hh,NONE,1.1 Visitor.hh,NONE,1.1 AST.hh,1.2,1.3 Declaration.hh,1.2,1.3 SourceFile.hh,1.3,1.4
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Update of /cvs/synopsis/Synopsis/include/Synopsis
In directory frida:/tmp/cvs-serv20957/include/Synopsis
Added Files:
Kit.hh TypedList.hh
Log Message:
more work on C++ API
--- NEW FILE: Kit.hh ---
// $Id: Kit.hh,v 1.1 2004/01/25 21:21:54 stefan Exp $
//
// Copyright (C) 2004 Stefan Seefeld
// All rights reserved.
// Licensed to the public under the terms of the GNU LGPL (>= 2),
// see the file COPYING for details.
//
#ifndef _Synopsis_Kit_hh
#define _Synopsis_Kit_hh
#include <Synopsis/Module.hh>
namespace Synopsis
{
class Kit : public Module
{
public:
Kit(const std::string &name) : Module(name) {}
template <typename T>
T create(const char *name, const Tuple &t = Tuple(), const Dict &d = Dict())
{ return dict().get(name)(t, d);}
};
}
#endif
--- NEW FILE: TypedList.hh ---
// $Id: TypedList.hh,v 1.1 2004/01/25 21:21:54 stefan Exp $
//
// Copyright (C) 2004 Stefan Seefeld
// All rights reserved.
// Licensed to the public under the terms of the GNU LGPL (>= 2),
// see the file COPYING for details.
//
#ifndef _Synopsis_TypedList_hh
#define _Synopsis_TypedList_hh
#include <Synopsis/Object.hh>
namespace Synopsis
{
//. A typed list replace some modifiers by a 'more typed' variant
//. This is really just provided to allow more expressive statements
template <typename T>
class TypedList : public List
{
public:
TypedList(size_t i = 0) : List(i) {}
TypedList(Object o) : List(o) {} // should we typecheck here all items ?
void set(int i, const T &s) { List::set(i, s);}
void append(const T &s) { List::append(s);}
void insert(int i, const T &s) { List::insert(i, s);}
};
}
#endif
- Previous message: [Synopsis-changes] Synopsis/Synopsis/tests/Cxx-API/Python/src Dict.cc,1.1,1.2 Interpreter.cc,1.3,1.4 List.cc,1.2,1.3 Tuple.cc,1.2,1.3
- Next message: [Synopsis-changes] Synopsis/Synopsis/include/Synopsis/AST ASTKit.hh,NONE,1.1 Declared.hh,NONE,1.1 Type.hh,NONE,1.1 TypeKit.hh,NONE,1.1 Visitor.hh,NONE,1.1 AST.hh,1.2,1.3 Declaration.hh,1.2,1.3 SourceFile.hh,1.3,1.4
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Synopsis-changes mailing list