NeuroML C++ API  2.3.0
C++ API for NeuroML 2
NeuroML_custom.hxx
1 // Copyright 2017 University College London.
2 // See Licence.txt for details.
3 
4 #ifndef NEURO_ML_CUSTOM_HXX
5 #define NEURO_ML_CUSTOM_HXX
6 
7 #include <iosfwd> // For streaming operators & writeToFile
8 
9 namespace neuroml2
10 {
11 
18 std::unique_ptr<NeuroMLDocument> parseFile(const std::string& filePath);
19 
29 
39 {
40 public:
47  void writeToFile(const std::string& pathToFile, std::ios_base::openmode mode = std::ios_base::out) const;
48 
53 
58  NeuroMLDocument (const id_type&);
59 
68  NeuroMLDocument (const ::xercesc::DOMElement& e,
69  ::xml_schema::flags f = 0,
70  ::xml_schema::container* c = 0);
71 
82  ::xml_schema::flags f = 0,
83  ::xml_schema::container* c = 0);
84 
96  virtual NeuroMLDocument*
97  _clone (::xml_schema::flags f = 0,
98  ::xml_schema::container* c = 0) const;
99 
109  operator= (const NeuroMLDocument& x);
110 
112 
116  virtual
117  ~NeuroMLDocument ();
118 };
119 
132 {
133 public:
134  // Our additions to the class
135 
139  unsigned num_segments() const;
140 
141  // Constructor signatures etc. copied from the auto-generated base class.
142 
151  Morphology(const id_type&);
152 
161  Morphology(const ::xercesc::DOMElement& e,
162  ::xml_schema::flags f = 0,
163  ::xml_schema::container* c = 0);
164 
174  Morphology(const Morphology& x,
175  ::xml_schema::flags f = 0,
176  ::xml_schema::container* c = 0);
177 
189  virtual Morphology*
190  _clone(::xml_schema::flags f = 0,
191  ::xml_schema::container* c = 0) const;
192 
201  Morphology&
202  operator=(const Morphology& x);
203 
205 
209  virtual
210  ~Morphology();
211 };
212 
218 class Segment: public Segment_base
219 {
220 public:
221  // Our additions to the class
222 
226  double length() const;
227 
231  double volume() const;
232 
236  double surface_area() const;
237 
238  // Constructor signatures etc. copied from the auto-generated base class.
239 
248  Segment(const id_type&,
249  const distal_type&);
250 
259  Segment(const id_type&,
260  ::std::unique_ptr<distal_type>);
261 
270  Segment(const ::xercesc::DOMElement& e,
271  ::xml_schema::flags f = 0,
272  ::xml_schema::container* c = 0);
273 
283  Segment(const Segment& x,
284  ::xml_schema::flags f = 0,
285  ::xml_schema::container* c = 0);
286 
298  virtual Segment*
299  _clone(::xml_schema::flags f = 0,
300  ::xml_schema::container* c = 0) const;
301 
310  Segment&
311  operator=(const Segment& x);
312 
314 
318  virtual
319  ~Segment();
320 };
321 
331 {
332  // Our additions to the class
333 protected:
334  unsigned _get_cell_id(const std::string& id_string) const;
335 
336 public:
337  unsigned get_pre_cell_id() const;
338 
339  unsigned get_post_cell_id() const;
340 
341 // std::string TODO: equiv of __str__ - override operator<<?
342 
343  // Constructor signatures etc. copied from the auto-generated base class.
348 
353  Connection(const id_type&,
354  const preCellId_type&,
355  const postCellId_type&);
356 
365  Connection(const ::xercesc::DOMElement& e,
366  ::xml_schema::flags f = 0,
367  ::xml_schema::container* c = 0);
368 
378  Connection(const Connection& x,
379  ::xml_schema::flags f = 0,
380  ::xml_schema::container* c = 0);
381 
393  virtual Connection*
394  _clone(::xml_schema::flags f = 0,
395  ::xml_schema::container* c = 0) const;
396 
398 
402  virtual
403  ~Connection();
404 };
405 
406 // Streaming operators
407 
408 ::std::ostream&
409 operator<< (::std::ostream&, const Connection&);
410 
411 }
412 
413 #endif // NEURO_ML_CUSTOM_HXX
Class corresponding to the Connection schema type.
Class corresponding to the Connection schema type.
virtual Connection * _clone(::xml_schema::flags f=0, ::xml_schema::container *c=0) const
Copy the instance polymorphically.
virtual ~Connection()
Destructor.
Connection(const id_type &, const preCellId_type &, const postCellId_type &)
Create an instance from the ultimate base and initializers for required elements and attributes.
Class corresponding to the Morphology schema type.
Class corresponding to the Morphology schema type.
virtual Morphology * _clone(::xml_schema::flags f=0, ::xml_schema::container *c=0) const
Copy the instance polymorphically.
unsigned num_segments() const
virtual ~Morphology()
Destructor.
Morphology(const id_type &)
Create an instance from the ultimate base and initializers for required elements and attributes.
Morphology & operator=(const Morphology &x)
Copy assignment operator.
Class corresponding to the NeuroMLDocument schema type.
Class corresponding to the NeuroMLDocument schema type.
NeuroMLDocument & operator=(const NeuroMLDocument &x)
Copy assignment operator.
NeuroMLDocument(const id_type &)
Create an instance from the ultimate base and initializers for required elements and attributes.
void writeToFile(const std::string &pathToFile, std::ios_base::openmode mode=std::ios_base::out) const
virtual NeuroMLDocument * _clone(::xml_schema::flags f=0, ::xml_schema::container *c=0) const
Copy the instance polymorphically.
virtual ~NeuroMLDocument()
Destructor.
Class corresponding to the Nml2PopulationReferencePath schema type.
Class corresponding to the NmlId schema type.
Class corresponding to the NonNegativeInteger schema type.
Class corresponding to the Point3DWithDiam schema type.
Class corresponding to the Segment schema type.
Class corresponding to the Segment schema type.
double volume() const
Segment & operator=(const Segment &x)
Copy assignment operator.
virtual ~Segment()
Destructor.
double length() const
double surface_area() const
Segment(const id_type &, const distal_type &)
Create an instance from the ultimate base and initializers for required elements and attributes.
virtual Segment * _clone(::xml_schema::flags f=0, ::xml_schema::container *c=0) const
Copy the instance polymorphically.
C++ namespace for the http://www.neuroml.org/schema/neuroml2 schema namespace.
std::string getSchemaPath()
std::unique_ptr< NeuroMLDocument > parseFile(const std::string &filePath)
::xsd::cxx::tree::type container
Alias for the anyType type.
::xsd::cxx::tree::flags flags
Parsing and serialization flags.
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.