Panda3D

Loading...
Searching...
No Matches
internalNameCollection.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file internalNameCollection.h
10 * @author drose
11 * @date 2002-03-16
12 */
13
14#ifndef INTERNALNAMECOLLECTION_H
15#define INTERNALNAMECOLLECTION_H
16
17#include "pandabase.h"
18#include "pointerToArray.h"
19#include "internalName.h"
20
21/**
22 *
23 */
24 class EXPCL_PANDA_PGRAPH InternalNameCollection {
25PUBLISHED:
26 InternalNameCollection();
27 InternalNameCollection(const InternalNameCollection &copy);
28 void operator = (const InternalNameCollection &copy);
29 INLINE ~InternalNameCollection();
30
31 void add_name(const InternalName *name);
32 bool remove_name(const InternalName *name);
33 void add_names_from(const InternalNameCollection &other);
34 void remove_names_from(const InternalNameCollection &other);
35 void remove_duplicate_names();
36 bool has_name(const InternalName *name) const;
37 void clear();
38
39 int get_num_names() const;
40 const InternalName *get_name(int index) const;
41 MAKE_SEQ(get_names, get_num_names, get_name);
42 const InternalName *operator [] (int index) const;
43 int size() const;
44 INLINE void operator += (const InternalNameCollection &other);
45 INLINE InternalNameCollection operator + (const InternalNameCollection &other) const;
46
47 void output(std::ostream &out) const;
48 void write(std::ostream &out, int indent_level = 0) const;
49
50 private:
51 typedef PTA(CPT(InternalName)) InternalNames;
52 InternalNames _names;
53};
54
55INLINE std::ostream &operator << (std::ostream &out, const InternalNameCollection &col) {
56 col.output(out);
57 return out;
58}
59
60#include "internalNameCollection.I"
61
62#endif
InternalNameCollection
Definition internalNameCollection.h:24
InternalNameCollection::add_names_from
void add_names_from(const InternalNameCollection &other)
Adds all the InternalNames indicated in the other collection to this name.
Definition internalNameCollection.cxx:98
InternalNameCollection::size
int size() const
Returns the number of names in the collection.
Definition internalNameCollection.cxx:205
InternalNameCollection::get_name
get_name
Returns the nth InternalName in the collection.
Definition internalNameCollection.h:41
InternalNameCollection::has_name
bool has_name(const InternalName *name) const
Returns true if the indicated InternalName appears in this collection, false otherwise.
Definition internalNameCollection.cxx:154
InternalNameCollection::remove_duplicate_names
void remove_duplicate_names()
Removes any duplicate entries of the same InternalNames on this collection.
Definition internalNameCollection.cxx:129
InternalNameCollection::clear
void clear()
Removes all InternalNames from the collection.
Definition internalNameCollection.cxx:167
InternalNameCollection::write
void write(std::ostream &out, int indent_level=0) const
Writes a complete multi-line description of the InternalNameCollection to the indicated output stream...
Definition internalNameCollection.cxx:227
InternalNameCollection::add_name
void add_name(const InternalName *name)
Adds a new InternalName to the collection.
Definition internalNameCollection.cxx:46
InternalNameCollection::remove_name
bool remove_name(const InternalName *name)
Removes the indicated InternalName from the collection.
Definition internalNameCollection.cxx:65
InternalNameCollection::remove_names_from
void remove_names_from(const InternalNameCollection &other)
Removes from this collection all of the InternalNames listed in the other collection.
Definition internalNameCollection.cxx:111
InternalNameCollection::get_num_names
get_num_names
Returns the number of InternalNames in the collection.
Definition internalNameCollection.h:41
InternalNameCollection::output
void output(std::ostream &out) const
Writes a brief one-line description of the InternalNameCollection to the indicated output stream.
Definition internalNameCollection.cxx:214
InternalName
Encodes a string name in a hash table, mapping it to a pointer.
Definition internalName.h:38
internalNameCollection.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
internalName.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pointerToArray.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.