Logo Search packages:      
Sourcecode: inkscape version File versions

Inkscape::SvgProfile Class Reference

#include <svg-profile.h>

List of all members.


Detailed Description

A class that contains information on which SVG profiles are marked for the object.

The basic functionality here is to allow marking of which profiles are supported or required by some other object. The basic implementation of that is a bitfield, a data type that has bits to be able to be set depending on whether or not that particular feature is available. This implementation is a little more complex for a coulple of reasons.

The first reason for making it be more complex is to make it into a nice C++ friendly class, where the actual bits aren't required by the calling application. This is accomplished by use of the SvgProfileType enum, and having the various fields in there.

The second reason that this is more complex is that it is reasonable that the enum will grow to be greater than the native integer of a given system. As more profiles and distinctions are made, there will have to be more entries in the enum. In order to combat this, the BitField class was created. This creates consistent operations independent of how many integers are used to represent the particular bitfield.

The entire class has been optimized for inlining and compiler reduction of code. All entires should allow being put in a structure or other static allocation. For most operations, simple and/or instructions in the processor is required after optimization.

Adding additional profiles to the class is as easy as adding entires into the enum. Adding additional aggregates requires adding to the enum, and adding the aggregate into the constructor for the class.

Definition at line 49 of file svg-profile.h.


Public Types

enum  SvgProfileType {
  BASIC_OPERATION = 0, SVG_BASE_1_0, SVG_BASE_1_1, SVG_BASE_1_2,
  SVG_BASE_2_0, SVG_MOBILE_TINY_1_1, SVG_MOBILE_BASIC_1_1, SVG_MOBILE_TINY_1_2,
  SVG_MOBILE_BASIC_1_2, SVG_PRINT_1_1, PROFILE_UNIQUE_CNT, SVG_BASE_ALL,
  SVG_MOBILE_ALL, SVG_TINY_ALL, SVG_BASIC_ALL, ALL
}
 The enum listing all the different profiles supported, and some aggregate ones supported. More...

Public Member Functions

bool operator== (const SvgProfile &in_profile) const
 A function to check equality of two SvgProfiles. It doesn't quite check equality though, it more ensures that there is a profile supported by both objects. This would be similar to: (a & b) != 0 in a standard bitfield impelemtation. But is done this way for simplicity.
SvgProfile operator| (const SvgProfile &other) const
 A function allow combining of SvgProfiles with each other into a larger SvgProfile.
SvgProfileoperator|= (const SvgProfile &other)
 A quick way to add additional profiles to the currently allocated object.
 SvgProfile (SvgProfileType type)
 A constructor for SvgProfile which sets up the bitfield based on the SvgProfileType getting passed in.

Private Member Functions

 SvgProfile (const BitField &in_field)
 Create an SvgProfile with an already created bitfield.

Private Attributes

BitField _profile
 The actual data stored on the profile.

Classes

class  BitField
 The core of the SvgProfile class, this implements a bitfield which can be several integers large with standard operations independent of size. More...

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index