HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ICollections.h
Go to the documentation of this file.
1 //-*****************************************************************************
2 //
3 // Copyright (c) 2009-2015,
4 // Sony Pictures Imageworks Inc. and
5 // Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
6 //
7 // All rights reserved.
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are
11 // met:
12 // * Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 // * Redistributions in binary form must reproduce the above
15 // copyright notice, this list of conditions and the following disclaimer
16 // in the documentation and/or other materials provided with the
17 // distribution.
18 // * Neither the name of Sony Pictures Imageworks, nor
19 // Industrial Light & Magic, nor the names of their contributors may be used
20 // to endorse or promote products derived from this software without specific
21 // prior written permission.
22 //
23 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 //
35 //-*****************************************************************************
36 
37 #ifndef _Alembic_AbcCollections_ICollections_h_
38 #define _Alembic_AbcCollections_ICollections_h_
39 
40 #include <Alembic/Abc/All.h>
41 #include <Alembic/Util/Export.h>
43 
44 namespace Alembic {
45 namespace AbcCollection {
46 namespace ALEMBIC_VERSION_NS {
47 
49  : public Abc::ISchema<CollectionsSchemaInfo>
50 {
51 public:
52 
54 
55  // default constructor creates an empty ICollectionSchema
57 
58  template <class CPROP_PTR>
59  ICollectionsSchema( CPROP_PTR iParent,
60  const std::string &iName,
61  const Abc::Argument &iArg0 = Abc::Argument(),
62  const Abc::Argument &iArg1 = Abc::Argument())
63  : Abc::ISchema<CollectionsSchemaInfo>( iParent, iName, iArg0, iArg1 )
64  {
65  init( iArg0, iArg1 );
66  }
67 
68  //! This constructor is the same as above, but with default
69  //! schema name used.
70  template <class CPROP_PTR>
71  explicit ICollectionsSchema( CPROP_PTR iParent,
72  const Abc::Argument &iArg0 = Abc::Argument(),
73  const Abc::Argument &iArg1 = Abc::Argument() )
74  : Abc::ISchema<CollectionsSchemaInfo>( iParent, iArg0, iArg1 )
75  {
76  init( iArg0, iArg1 );
77  }
78 
79  //! Wrap an existing schema object
80  template <class CPROP_PTR>
81  ICollectionsSchema( CPROP_PTR iThis,
83  const Abc::Argument &iArg0 = Abc::Argument(),
84  const Abc::Argument &iArg1 = Abc::Argument() )
85  : Abc::ISchema<CollectionsSchemaInfo>( iThis, iFlag, iArg0, iArg1 )
86  {
87  init( iArg0, iArg1 );
88  }
89 
90  //! Copy constructor.
92  : Abc::ISchema<CollectionsSchemaInfo>()
93  {
94  *this = iCopy;
95  }
96 
97  //! Returns the number of collections that we have
98  size_t getNumCollections() { return m_collections.size(); }
99 
100  //! Return a collection by index
101  Abc::IStringArrayProperty getCollection( size_t i );
102 
103  //! Return a collection by name
104  Abc::IStringArrayProperty getCollection( const std::string & iName );
105 
106  //! Returns the name of a collection at a given index
107  std::string getCollectionName( size_t i );
108 
109  //! Returns whether this function set is valid.
110  bool valid() const
111  {
113  }
114 
115 protected:
116  void init( const Abc::Argument &iArg0,
117  const Abc::Argument &iArg1 );
118 
119  std::vector< Abc::IStringArrayProperty > m_collections;
120 
121 };
122 
123 //! Object declaration
125 
126 typedef Util::shared_ptr< ICollections > ICollectionsPtr;
127 
128 } // End namespace ALEMBIC_VERSION_NS
129 
130 using namespace ALEMBIC_VERSION_NS;
131 
132 } // End namespace AbcCollection
133 } // End namespace Alembic
134 
135 #endif
ICollectionsSchema(CPROP_PTR iParent, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
Definition: ICollections.h:71
ICollectionsSchema(CPROP_PTR iThis, Abc::WrapExistingFlag iFlag, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
Wrap an existing schema object.
Definition: ICollections.h:81
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
bool valid() const
Returns whether this function set is valid.
Definition: ICollections.h:110
Abc::ISchemaObject< ICollectionsSchema > ICollections
Object declaration.
Definition: ICollections.h:124
size_t getNumCollections()
Returns the number of collections that we have.
Definition: ICollections.h:98
png_uint_32 i
Definition: png.h:2877
ICollectionsSchema(const ICollectionsSchema &iCopy)
Copy constructor.
Definition: ICollections.h:91
Util::shared_ptr< ICollections > ICollectionsPtr
Definition: ICollections.h:126
std::vector< Abc::IStringArrayProperty > m_collections
Definition: ICollections.h:119
ICollectionsSchema(CPROP_PTR iParent, const std::string &iName, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
Definition: ICollections.h:59
#define ALEMBIC_EXPORT
Definition: Export.h:51
#define ALEMBIC_VERSION_NS
Definition: Foundation.h:104